diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6cbe618..b610475 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,88 +1,29 @@ name: Rust on: - workflow_run: - workflows: ["Check Build"] - types: - - completed + release: + types: [created] jobs: - build: + release: + name: release ${{ matrix.target }} runs-on: ubuntu-latest - - if: ${{ github.event.workflow_run.conclusion == 'success' }} - + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-pc-windows-gnu + archive: zip + - target: x86_64-unknown-linux-musl + archive: tar.gz tar.xz tar.zst + - target: x86_64-apple-darwin + archive: zip steps: - - name: Checkout - uses: actions/checkout@v1 - - - name: Install latest rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - default: true - override: true - - - name: Build - run: cargo build --all --release && strip target/release/netl2 && mv target/release/netl2 target/release/netl2_amd64 - - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - files: | - target/release/netl2_amd64 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - build-win: - runs-on: windows-latest - - steps: - - name: Checkout - uses: actions/checkout@v1 - - - name: Install latest rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - default: true - override: true - - - name: Build - run: cargo build --all --release - - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - files: target/release/netl2.exe + - uses: actions/checkout@master + - name: Compile and release + uses: rust-build/rust-build.action@v1.4.3 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - build-mac: - runs-on: macos-latest - - steps: - - name: Checkout - uses: actions/checkout@v1 - - - name: Install latest rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: x86_64-apple-darwin - default: true - override: true - - - name: Build for mac - run: cargo build --all --release && strip target/release/netl2 && mv target/release/netl2 target/release/netl2_darwin - - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') with: - files: | - target/release/netl2_darwin - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RUSTTARGET: ${{ matrix.target }} + ARCHIVE_TYPES: ${{ matrix.archive }} \ No newline at end of file