-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (61 loc) · 2.13 KB
/
Copy pathversion.yml
File metadata and controls
64 lines (61 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
name: Version
run-name: Cut ${{ github.event.inputs.version }}
on:
workflow_dispatch:
inputs:
version:
description: Version to cut
required: true
jobs:
tag:
name: Tag
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v7
with:
token: ${{ secrets.GH_TOKEN }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v7
with:
git_user_signingkey: true
git_commit_gpgsign: true
git_committer_name: ${{ secrets.GIT_USER_NAME }}
git_committer_email: ${{ secrets.GIT_USER_EMAIL }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Setup
uses: ./.github/actions/setup
- name: Cut ${{ github.event.inputs.version }} version
run: bundle exec gem bump --no-commit --version ${{ github.event.inputs.version }}
- name: Update Gemfile.lock
run: |
bundle config set --local deployment 'false'
bundle install
- name: Get meta
id: meta
run: |
version=$(bundle exec parse-gemspec-cli parse *.gemspec | jq -r .version)
echo "version=${version}" >> $GITHUB_OUTPUT
- name: Tag ${{ github.event.inputs.version }} version
run: |
git add .
git commit --sign -m "${VERSION}"
git tag --sign "v${VERSION}" -m "${VERSION}"
git push --follow-tags
env:
VERSION: ${{ steps.meta.outputs.version }}
- name: Record prerelease channel
env:
VERSION: ${{ github.event.inputs.version }}
run: |
case "$VERSION" in
*-*) channel="${VERSION#*-}"; channel="${channel%%.*}" ;;
*) echo "Stable release, no channel note required."; exit 0 ;;
esac
git notes --ref "semantic-release-v$VERSION" add --force \
--message "{\"channels\":[\"$channel\"]}" "v$VERSION^{commit}"
git push origin "refs/notes/semantic-release-v$VERSION"
echo "Recorded v$VERSION on the '$channel' channel."