-
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (47 loc) · 1.49 KB
/
release.yml
File metadata and controls
51 lines (47 loc) · 1.49 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
name: release
on:
push:
branches: ["master"]
paths-ignore:
- '.devcontainer/**'
- '.github/workflows/**'
tags-ignore: ['**']
jobs:
tests:
uses: ./.github/workflows/tests.yml
tag-release:
runs-on: ubuntu-latest
needs: [tests]
steps:
- name: Checkout code
uses: actions/checkout@v4
with: # important, must be defined on checkout to kick publish (defining in setup/node doesn't work)
token: ${{ secrets.GH_TOKEN }}
- name: Set Go version from .prototools
id: set_go_version
run: |
GO_VERSION=$(grep '^go' .prototools | grep -o '".*"' | tr -d '"')
echo "GO_VERSION=$GO_VERSION" >> $GITHUB_ENV
- name: node
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
# cache: "npm" # needs lockfile if enabled
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: tag release
run: |
# ignore if commit message is chore(release): ...
if [[ $(git log -1 --pretty=%B) =~ ^chore\(release\):.* ]]; then
echo "Commit message starts with 'chore(release):', skipping release"
exit 0
fi
git config --local user.email "creadbot@github.com"
git config --local user.name "creadbot_github"
set -v
npm install
npx commit-and-tag-version
git push
git push --tags