Skip to content

Commit

Permalink
Merge pull request #16 from appsignal/add-release-ci
Browse files Browse the repository at this point in the history
Add release publishing to Github Actions
  • Loading branch information
unflxw authored Nov 7, 2024
2 parents f2fece0 + 0a11bb3 commit 3986258
Show file tree
Hide file tree
Showing 13 changed files with 250 additions and 294 deletions.
Empty file added .changesets/.gitkeep
Empty file.
6 changes: 6 additions & 0 deletions .changesets/initial-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
bump: minor
type: add
---

Initial release
75 changes: 75 additions & 0 deletions .github/workflows/publish_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
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}}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target
/release
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# `appsignal-wrap` changelog

Loading

0 comments on commit 3986258

Please sign in to comment.