This repository has been archived by the owner on Sep 29, 2024. It is now read-only.
Release #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version_number: | |
description: "Version number" | |
required: true | |
env: | |
VERSION: ${{ github.event.inputs.version_number }} | |
jobs: | |
run_tests: | |
name: Run tests | |
runs-on: macos-13 | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: '15.1' | |
- name: Run tests | |
run: | | |
swift test | |
publish_version: | |
name: Publish release | |
runs-on: ubuntu-latest | |
needs: run_tests | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@v5 | |
with: | |
gpg_private_key: ${{ secrets.GPG_KEY }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
git_tag_gpgsign: true | |
git_push_gpgsign: false | |
- name: Tag release | |
run: | | |
DATE=`date "+%Y-%m-%d"` | |
COMMIT_MESSAGE="[ci skip] Set release date" | |
TAG_MESSAGE="Release" | |
sed -i'' -E "s/^## Unreleased.*$/## $VERSION ($DATE)/" CHANGELOG.md | |
git add CHANGELOG.md | |
git commit -m "$COMMIT_MESSAGE" | |
git tag "v$VERSION" -m "$TAG_MESSAGE" | |
git push && git push --tags | |
- name: Publish | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: "v${{ env.VERSION }}" | |
generate_release_notes: true |