2021-12-01 12:30:04 +00:00
|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
2023-12-14 09:17:46 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
version_number:
|
|
|
|
description: "Version number"
|
|
|
|
required: true
|
2021-12-01 12:30:04 +00:00
|
|
|
|
2023-12-14 09:31:22 +00:00
|
|
|
env:
|
|
|
|
VERSION: ${{ github.event.inputs.version_number }}
|
|
|
|
|
2021-12-01 12:30:04 +00:00
|
|
|
jobs:
|
|
|
|
run_tests:
|
2021-12-02 23:16:28 +00:00
|
|
|
name: Run tests
|
2022-05-17 16:06:51 +00:00
|
|
|
runs-on: macos-12
|
2021-12-01 12:30:04 +00:00
|
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
2023-07-08 08:01:44 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-12-01 12:30:04 +00:00
|
|
|
- uses: maxim-lobanov/setup-xcode@v1
|
|
|
|
with:
|
|
|
|
xcode-version: latest-stable
|
|
|
|
- name: Run tests
|
|
|
|
run: |
|
|
|
|
swift test
|
2023-12-16 19:50:10 +00:00
|
|
|
publish_version:
|
|
|
|
name: Publish release
|
2021-12-01 12:30:04 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: run_tests
|
|
|
|
steps:
|
2023-07-08 08:01:44 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-12-01 12:30:04 +00:00
|
|
|
- name: Import GPG key
|
2023-07-08 08:01:44 +00:00
|
|
|
uses: crazy-max/ghaction-import-gpg@v5
|
2021-12-01 12:30:04 +00:00
|
|
|
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
|
2023-12-16 19:50:10 +00:00
|
|
|
- name: Publish
|
2023-12-14 09:31:22 +00:00
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
tag_name: "v${{ env.VERSION }}"
|
|
|
|
generate_release_notes: true
|