diff --git a/.github/workflows/build_and_release.yml b/.github/workflows/build_and_release.yml deleted file mode 100644 index 4a2b97e..0000000 --- a/.github/workflows/build_and_release.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build and release - -on: - push: - branches: - - main - release: - types: [created] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true - - - name: Build for Windows - run: | - cargo build --release --target x86_64-pc-windows-gnu - - - name: Build for Linux - run: | - cargo build --release --target x86_64-unknown-linux-gnu - - - name: Build for MacOS - run: | - cargo build --release --target x86_64-apple-darwin - - - name: Create release - uses: actions/create-release@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: false - prerelease: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..405c05c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +name: Release +on: + push: + branches: [main] + release: + types: [created] + +jobs: + release: + name: release ${{ matrix.target }} + runs-on: ubuntu-latest + 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: + - uses: actions/checkout@master + - name: Compile and release + uses: rust-build/rust-build.action@v1.4.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + RUSTTARGET: ${{ matrix.target }} + ARCHIVE_TYPES: ${{ matrix.archive }}