diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ddbd69a..ebdaf29 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,43 +4,50 @@ on: tags: - v* jobs: + # Better to check first, runners other than ubuntu-latest take up more free minutes + check: + name: Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check + run: cargo check --all-features --locked + build: + needs: [check] strategy: matrix: include: - os: ubuntu-latest host: linux - label: linux-x86_64 + arch: x86_64 target: x86_64-unknown-linux-gnu - os: windows-latest host: windows - label: windows-x86_64 + arch: x86_64 target: x86_64-pc-windows-msvc - os: macos-latest host: macos - label: macos-x86_64 + arch: x86_64 target: x86_64-apple-darwin - - os: macos-latest-xlarge - host: macos - label: macos-aarch64 - target: aarch64-apple-darwin + # not included in free minutes + # TODO: find a replacement (can't cross compile for aarch64 on x86_64 due to OpenSSL) + # - os: macos-latest-xlarge + # host: macos + # arch: aarch64 + # target: aarch64-apple-darwin runs-on: ${{ matrix.os }} - name: Build for ${{ matrix.label }} + name: Build for ${{ matrix.host }}-${{ matrix.arch }} steps: - uses: actions/checkout@v4 - - name: Set up Rust - uses: moonrepo/setup-rust@v1 - with: - targets: ${{ matrix.target }} - - name: Set env shell: bash run: | BIN_NAME=pesde - ARCHIVE_NAME=$BIN_NAME-$(echo ${{ github.ref_name }} | cut -c 2-)-${{ matrix.label }}.zip + ARCHIVE_NAME=$BIN_NAME-$(echo ${{ github.ref_name }} | cut -c 2-)-${{ matrix.host }}-${{ matrix.arch }}.zip echo "BIN_NAME=$BIN_NAME" >> $GITHUB_ENV echo "ARCHIVE_NAME=$ARCHIVE_NAME" >> $GITHUB_ENV @@ -65,13 +72,22 @@ jobs: name: ${{ env.ARCHIVE_NAME }} path: ${{ env.ARCHIVE_NAME }} + publish: + name: Publish to crates.io + runs-on: ubuntu-latest + needs: [build] + steps: + - uses: actions/checkout@v4 + - name: Publish + run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} --allow-dirty --locked + create_release: name: Create Release runs-on: ubuntu-latest permissions: contents: write pull-requests: read - needs: [build] + needs: [build, publish] steps: - uses: actions/checkout@v4 with: @@ -101,7 +117,4 @@ jobs: body: ${{ steps.git-cliff.outputs.content }} draft: true prerelease: false - files: artifacts/* - - - name: Publish on crates.io - run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} --allow-dirty --locked \ No newline at end of file + files: artifacts/* \ No newline at end of file