-
Notifications
You must be signed in to change notification settings - Fork 13
76 lines (69 loc) · 2.56 KB
/
master.yml
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
66
67
68
69
70
71
72
73
74
75
76
name: 'master'
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-22.04
outputs:
needs-update: ${{ steps.diff.outcome != 'success' }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: |
npm-
- run: |
npm ci
npm run build
npm run format-check
npm run lint
npm run package
npm run test
- name: Check for changes (fail if we forgot to update dist)
run: git diff --quiet dist
id: diff
continue-on-error: true
- name: Set up commit signing w/ GPG
if: ${{ steps.diff.outcome != 'success' }}
id: configure
uses: tradeshift/actions-git/configure-from-gpg-key@v1
with:
gpg-key: ${{ secrets.TRADESHIFTCI_GPG_KEY }}
- name: PR build changes if needed
uses: tradeshift/create-pull-request@v6
if: ${{ steps.diff.outcome != 'success' }}
with:
commit-message: "build: update dist folder"
branch: release-update-dist
title: "Update for release: update package runtime"
body: |
This PR is created automatically because the repo has been changed
without updating the packaged version in the `dist` folder.
Before these changes can be released, the `dist` folder has to be
updated. By merging this when the build is green, a new release
will be created based on the list of changes since the last release.
For more info see [semantic-release.gitbook.io/semantic-release/](https://semantic-release.gitbook.io/semantic-release/)
token: ${{ secrets.GH_TOKEN }}
committer: ${{ steps.configure.outputs.user }}
author: ${{ steps.configure.outputs.user }}
release:
runs-on: ubuntu-latest
needs: [build]
if: ${{ needs.build.outputs.needs-update != 'true' }}
steps:
- uses: actions/checkout@v4
- uses: tradeshift/actions-semantic-release@v1
id: semantic-release
with:
check_name: Semantic release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Action tags (major version tag)
if: ${{ steps.semantic-release.outputs.new_release_published }}
run: |
git tag -f v${{ steps.semantic-release.outputs.new_release_major_version }}
git push -f origin v${{ steps.semantic-release.outputs.new_release_major_version }}