-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (56 loc) · 1.71 KB
/
release.yml
File metadata and controls
65 lines (56 loc) · 1.71 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
65
name: "Release"
on:
push:
branches:
- main
tags:
- '!*'
jobs:
next-version:
name: Get next release version
runs-on: ubuntu-latest
outputs:
git-tag: ${{ steps.git-tag.outputs.git-tag }}
new-release-version: ${{ steps.next-version.outputs.new-release-version }}
steps:
- name: checkout code
uses: actions/checkout@v3
- name: setup node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- name: install dependencies
run: npm ci
- name: find current latest release version
id: git-tag
shell: bash
run: echo "git-tag=`echo $(git describe --tags --abbrev=0 | sed -e 's/^v//')`" >> $GITHUB_OUTPUT
- name: find next release version
id: next-version
run: npm_config_yes=true npx semantic-release --dry-run
env:
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_PERSONAL_TOKEN }}
release:
name: Cut a release on GitHub
runs-on: ubuntu-latest
needs: next-version
if: needs.next-version.outputs.new-release-version == needs.next-version.outputs.git-tag
steps:
- name: checkout code
uses: actions/checkout@v3
- name: setup node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- name: install dependencies
run: npm ci
- name: make a release on GitHub
run: npm_config_yes=true npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_PERSONAL_TOKEN }}
GIT_AUTHOR_NAME: 'GP'
GIT_COMMITTER_NAME: 'GP'
GIT_AUTHOR_EMAIL: 'me@httgp.com'
GIT_COMMITTER_EMAIL: 'me@httgp.com'