Skip to content

Commit eff4591

Browse files
Add a release GHA workflow (#13)
* Add a release GHA workflow * Remove restriction on environment for testing purpose * Copy latest version from ci-environment * Remove prerelease check for testing purpose * Uncomment workflow steps * Add RELEASING.md file
1 parent cb312cf commit eff4591

File tree

4 files changed

+71
-0
lines changed

4 files changed

+71
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Pre-release checks
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
8+
check-commit-ancestor:
9+
name: Check commit ancestor
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Check commit has been pushed on origin/main
16+
run: |
17+
git fetch --quiet origin main
18+
git merge-base --is-ancestor HEAD origin/main

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Release npm module
2+
3+
on:
4+
push:
5+
branches:
6+
- release/*
7+
8+
jobs:
9+
10+
pre-release-check:
11+
uses: cucumber/cucumber-react/.github/workflows/prerelease-checks.yml@add-release-workflow
12+
13+
test:
14+
uses: cucumber/cucumber-react/.github/workflows/test.yml@add-release-workflow
15+
16+
publish-npm:
17+
name: Publish NPM module
18+
needs: [pre-release-check, test]
19+
runs-on: ubuntu-latest
20+
environment: Release
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
25+
- uses: actions/setup-node@v2
26+
with:
27+
node-version: '16'
28+
cache: 'npm'
29+
cache-dependency-path: package-lock.json
30+
31+
- run: npm install-ci-test
32+
33+
- run: npm run compile
34+
35+
- uses: cucumber/[email protected]
36+
with:
37+
npm-token: ${{ secrets.NPM_TOKEN }}
38+
39+
create-github-release:
40+
name: Create GitHub Release and Git tag
41+
needs: [publish-npm]
42+
runs-on: ubuntu-latest
43+
environment: Release
44+
permissions:
45+
contents: write
46+
47+
steps:
48+
- uses: actions/checkout@v2
49+
- uses: cucumber/[email protected]
50+
with:
51+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
pull_request:
88
branches:
99
- main
10+
workflow_call:
1011

1112
jobs:
1213
test:

RELEASING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See [.github/RELEASING](https://github.com/cucumber/.github/blob/main/RELEASING.md).

0 commit comments

Comments
 (0)