Skip to content

Commit

Permalink
ci(github-actions): add a GitHub Action to add MacOS binaries to GitH…
Browse files Browse the repository at this point in the history
…ub Release
  • Loading branch information
hituzi-no-sippo committed Sep 24, 2024
1 parent 0861d24 commit 6fb60b8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
28 changes: 27 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ jobs:
export AARCH64_MUSL_TGZ="${X86_64_MUSL_TGZ//x86_64/aarch64}"
export DEBIAN_URL="https://github.com/chevdor/tera-cli/releases/download/${{ env.RELEASE_VERSION }}/tera-cli_linux_amd64.deb"
export MACOS_TGZ_URL="https://github.com/chevdor/tera-cli/releases/download/${{ env.RELEASE_VERSION }}/tera-macos-${{ env.RELEASE_VERSION }}.tar.gz"
export X86_64_MACOS_TGZ="${x86_64_prefix}apple-darwin.tar.gz"
export AARCH64_MACOS_TGZ="${X86_64_MACOS_TGZ//x86_64/aarch64}"
export CHANGELOG=$(cat changelog.md)
tera --env --env-only --template templates/release.md > RELEASE_NOTES.md
Expand Down Expand Up @@ -238,3 +239,28 @@ jobs:
archive: tera-cli-$target
checksum: sha512
token: ${{ secrets.GITHUB_TOKEN }}

publish-macos-binaries:
needs: ["create_draft"]
runs-on: macos-latest

steps:
- uses: actions/checkout@v4

- name: Upload x86_64
uses: taiki-e/upload-rust-binary-action@v1
with:
bin: tera
target: x86_64-apple-darwin
archive: tera-cli-$target
checksum: sha512
token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload aarch64
uses: taiki-e/upload-rust-binary-action@v1
with:
bin: tera
target: aarch64-apple-darwin
archive: tera-cli-$target
checksum: sha512
token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion templates/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Download the binary for your OS from below:
- [aarch64 musl]({{ ARCHIVE_URL_PREFIX ~ AARCH64_MUSL_TGZ }})
- [Debian package]({{ DEBIAN_URL }})
- **MacOS**
- [Archive]({{ MACOS_TGZ_URL }})
- [x86_64]({{ ARCHIVE_URL_PREFIX ~ X86_64_MACOS_TGZ }})
- [aarch64]({{ ARCHIVE_URL_PREFIX ~ AARCH64_MACOS_TGZ }})
- **Windows**
- [Archive]({{ ARCHIVE_URL_PREFIX ~ WINDOWS_ZIP }})

Expand Down

0 comments on commit 6fb60b8

Please sign in to comment.