Skip to content

Publish a release

Publish a release #1

name: Publish a release
on:
# Trigger this release via the GitHub Actions interface for this workflow
workflow_dispatch:
env:
PUBLISH_GIT_USERNAME: "AppSignal release bot"
PUBLISH_GIT_EMAIL: "[email protected]"
PUBLISH_GIT_SSH_PATH: "/home/runner/.ssh"
PUBLISH_GIT_SIGN_KEY_PATH: "/home/runner/.ssh/sign_key"
jobs:
publish:
name: "Publish the release"
runs-on: ubuntu-22.04
steps:
- name: "Checkout the project"
uses: actions/checkout@v4
with:
ssh-key: "${{secrets.PUBLISH_DEPLOY_KEY}}"
path: "main"
- name: "Checkout Mono"
uses: actions/checkout@v4
with:
repository: "appsignal/mono"
path: "mono"
- name: "Configure Git"
run: |
mkdir -p "$PUBLISH_GIT_SSH_PATH"
echo "${{secrets.PUBLISH_GIT_SIGN_KEY}}" > "$PUBLISH_GIT_SIGN_KEY_PATH"
echo "${{secrets.PUBLISH_GIT_SIGN_PUBLIC_KEY}}" > "$PUBLISH_GIT_SIGN_KEY_PATH.pub"
chmod 600 "$PUBLISH_GIT_SIGN_KEY_PATH"
git config --global user.name "$PUBLISH_GIT_USERNAME (as ${{github.actor}})"
git config --global user.email "$PUBLISH_GIT_EMAIL"
git config --global gpg.format ssh
git config --global commit.gpgsign true
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"
id: version
working-directory: "./main"
run: |
../mono/bin/mono publish --no-package-push --yes
export RELEASE_VERSION="$(script/read_version)"
echo "RELEASE_VERSION=$RELEASE_VERSION" >> "$GITHUB_OUTPUT"
echo "TAG_NAME=v$RELEASE_VERSION" >> "$GITHUB_OUTPUT"
- name: "Create a release on the repository"
working-directory: "./main"
run: |
gh release create ${{steps.version.outputs.TAG_NAME}} \
--title "${{steps.version.outputs.RELEASE_VERSION}}" \
--notes-from-tag \
--verify-tag \
'release/x86_64-unknown-linux-gnu.tar.gz#Linux (x86_64)' \
'release/x86_64-unknown-linux-musl.tar.gz#Linux (x86_64, musl)' \
'release/aarch64-unknown-linux-gnu.tar.gz#Linux (arm64)' \
'release/aarch64-unknown-linux-musl.tar.gz#Linux (arm64, musl)'
env:
GH_TOKEN: ${{github.token}}