Skip to content

Commit

Permalink
Merge pull request #27 from appsignal/actually-publish-macos-releases
Browse files Browse the repository at this point in the history
Actually publish macOS releases
  • Loading branch information
unflxw authored Nov 22, 2024
2 parents 2ed3070 + 705b2a2 commit e00226f
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 8 deletions.
66 changes: 59 additions & 7 deletions .github/workflows/publish_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,60 @@ env:
PUBLISH_GIT_EMAIL: "[email protected]"

jobs:
build:
name: "Build the release"
runs-on: ${{matrix.runner}}
strategy:
fail-fast: true
matrix:
include:
- runner: ubuntu-22.04
target: "x86_64-unknown-linux-gnu"
- runner: ubuntu-22.04
target: "x86_64-unknown-linux-musl"
- runner: ubuntu-22.04
target: "aarch64-unknown-linux-gnu"
- runner: ubuntu-22.04
target: "aarch64-unknown-linux-musl"
- runner: macos-14
target: "x86_64-apple-darwin"
- runner: macos-14
target: "aarch64-apple-darwin"
steps:
- name: "Checkout the project"
uses: actions/checkout@v4

- name: "Install Cross"
run: |
cargo install cross
# Linux targets will cross compile on Docker images used by cross
- name: "Login to Docker Hub"
if: matrix.runner == 'ubuntu-22.04'
uses: docker/login-action@v3
with:
username: ${{secrets.PUBLISH_DOCKERHUB_USERNAME}}
password: ${{secrets.PUBLISH_DOCKERHUB_TOKEN}}

- name: "Build artifact"
run: |
script/build_artifact "${{matrix.target}}"
# Temporarily store the build artifact as a GitHub Action artifact to
# move it to the next job.
- name: "Store build artifact"
uses: actions/upload-artifact@v4
with:
name: "${{matrix.target}}"
path: "release/${{matrix.target}}.tar.gz"
retention-days: 1
if-no-files-found: error

publish:
name: "Publish the release"
runs-on: macos-14
needs:
- build
runs-on: ubuntu-22.04
steps:
- name: "Checkout the project"
uses: actions/checkout@v4
Expand Down Expand Up @@ -39,18 +90,19 @@ jobs:
touch ~/.ssh/allowed_signers
echo "$(git config --get user.email) namespaces=\"git\" $(cat $PUBLISH_GIT_SIGN_KEY_PATH.pub)" >> ~/.ssh/allowed_signers
git config --global user.signingkey "$PUBLISH_GIT_SIGN_KEY_PATH"
- name: "Install Cross"
run: |
cargo install cross
- name: "Login to Docker Hub"
uses: docker/login-action@v3
with:
username: ${{secrets.PUBLISH_DOCKERHUB_USERNAME}}
password: ${{secrets.PUBLISH_DOCKERHUB_TOKEN}}

- name: "Build artifacts and push release tag"
- name: "Fetch build artifacts"
uses: actions/download-artifact@v4
with:
path: release

- name: "Push release tag"
id: version
working-directory: "./main"
run: |
Expand All @@ -73,6 +125,6 @@ jobs:
'release/aarch64-unknown-linux-musl.tar.gz#Linux (arm64, musl)' \
'release/x86_64-apple-darwin.tar.gz#macOS (x86_64)' \
'release/aarch64-apple-darwin.tar.gz#macOS (arm64)' \
'release/install.sh#Installer script'
'install.sh#Installer script'
env:
GH_TOKEN: ${{github.token}}
2 changes: 1 addition & 1 deletion mono.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
language: "custom"
repo: "https://github.com/appsignal/appsignal-wrap"
build:
command: "script/build_artifacts"
command: "echo 'Can only build from GitHub Actions'"
publish:
command: "echo 'Can only publish from GitHub Actions'"
test:
Expand Down

0 comments on commit e00226f

Please sign in to comment.