Skip to content

Commit

Permalink
fix(ci): Windows binary extension and version string
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpovel committed Oct 22, 2023
1 parent f4c009f commit d93004b
Showing 1 changed file with 32 additions and 26 deletions.
58 changes: 32 additions & 26 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,53 @@ 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:
- os: ubuntu-latest
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 }}

Expand All @@ -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
Expand Down

0 comments on commit d93004b

Please sign in to comment.