Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
canac committed Mar 22, 2022
1 parent 3c8102e commit a04ac3a
Showing 1 changed file with 31 additions and 37 deletions.
68 changes: 31 additions & 37 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,29 @@ on:
jobs:
release:
name: ${{ matrix.target }}
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
target: [x86_64-unknown-linux-musl, arm-unknown-linux-musleabihf, armv7-unknown-linux-musleabihf, aarch64-unknown-linux-musl, x86_64-apple-darwin, aarch64-apple-darwin, x86_64-pc-windows-msvc, aarch64-pc-windows-msvc]
# include:
# - os: ubuntu-latest
# target: x86_64-unknown-linux-musl
# - os: ubuntu-latest
# target: arm-unknown-linux-musleabihf
# - os: ubuntu-latest
# target: armv7-unknown-linux-musleabihf
# - os: ubuntu-latest
# target: aarch64-unknown-linux-musl
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: ubuntu-latest
target: arm-unknown-linux-musleabihf
- os: ubuntu-latest
target: armv7-unknown-linux-musleabihf
- os: ubuntu-latest
target: aarch64-unknown-linux-musl

# - os: macos-11
# target: x86_64-apple-darwin
# - os: macos-11
# target: aarch64-apple-darwin
- os: macos-11
target: x86_64-apple-darwin
- os: macos-11
target: aarch64-apple-darwin

# - os: windows-latest
# target: x86_64-pc-windows-msvc
# - os: windows-latest
# target: aarch64-pc-windows-msvc
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: windows-latest
target: aarch64-pc-windows-msvc
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand All @@ -57,27 +56,23 @@ jobs:
- name: Build binary
uses: actions-rs/cargo@v1
with:
use-cross: ${{ runner.os == 'Linux' }}
command: build
args: --release --locked --target=${{ matrix.target }} --color=always --verbose
use-cross: ${{ runner.os == 'Linux' }}

- name: Package
- name: Package (*nix)
if: runner.os != 'Windows'
run: >
tar -cv LICENSE README.md -C target/${{ matrix.target }}/release/ portman | gzip --best > '${{ env.ARTIFACT_NAME }}.tar.gz'
# - name: Package (*nix)
# if: runner.os != 'Windows'
# run: >
# tar -cv
# LICENSE README.md
# -C target/${{ matrix.target }}/release/ portman
# | gzip --best > '${{ env.ARTIFACT_NAME }}.tar.gz'
# - name: Package (Windows)
# if: runner.os == 'Windows'
# run: >
# 7z a ${{ env.ARTIFACT_NAME }}.zip
# LICENSE README.md
# ./target/${{ matrix.target }}/release/portman.exe
tar -cv
LICENSE README.md
-C target/${{ matrix.target }}/release/ portman
| gzip --best > '${{ env.ARTIFACT_NAME }}.tar.gz'
- name: Package (Windows)
if: runner.os == 'Windows'
run: >
7z a ${{ env.ARTIFACT_NAME }}.zip
LICENSE README.md
./target/${{ matrix.target }}/release/portman.exe
- name: Upload artifact
uses: actions/upload-artifact@v2
Expand All @@ -90,7 +85,6 @@ jobs:
- name: Create release
uses: softprops/action-gh-release@v1
with:
draft: true
files: |
*.zip
*.tar.gz

0 comments on commit a04ac3a

Please sign in to comment.