diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a303994d..9498e763 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,9 +69,35 @@ jobs: - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 + release-please: + name: Execute release chores + + runs-on: ubuntu-latest + + outputs: + created: ${{ steps.release.outputs.release_created }} + tag_name: ${{ steps.release.outputs.tag_name }} + + steps: + # https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow + - uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + + - uses: google-github-actions/release-please-action@v3 + id: release + with: + # Token needs: `contents: write`, `pull-requests: write` + token: ${{ steps.app-token.outputs.token }} + release-type: rust + build-upload: name: Build and upload binaries + needs: release-please + strategy: matrix: include: @@ -79,14 +105,17 @@ jobs: target: x86_64-unknown-linux-gnu crate: srgn binary: srgn + extension: "" - os: macos-latest target: x86_64-apple-darwin crate: srgn binary: srgn + extension: "" - os: windows-latest target: x86_64-pc-windows-msvc crate: srgn binary: srgn + extension: ".exe" runs-on: ${{ matrix.os }} @@ -105,32 +134,9 @@ jobs: - name: Upload binaries uses: actions/upload-artifact@v3 with: - name: "${{ matrix.crate }}-${{ matrix.target }}-v0.0.1" - path: "target/${{ matrix.target }}/release/${{ matrix.binary }}" - - release-please: - name: Execute release chores - - runs-on: ubuntu-latest - - outputs: - created: ${{ steps.release.outputs.release_created }} - tag_name: ${{ steps.release.outputs.tag_name }} - - steps: - # https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow - - uses: actions/create-github-app-token@v1 - id: app-token - with: - app-id: ${{ secrets.APP_ID }} - private-key: ${{ secrets.APP_PRIVATE_KEY }} - - - uses: google-github-actions/release-please-action@v3 - id: release - with: - # Token needs: `contents: write`, `pull-requests: write` - token: ${{ steps.app-token.outputs.token }} - release-type: rust + name: "${{ matrix.crate }}-${{ matrix.target }}-${{ needs.release-please.outputs.tag_name }}" + path: "target/${{ matrix.target }}/release/${{ matrix.binary }}${{ matrix.extension }}" + if-no-files-found: error publish: name: Publish to crates.io