Skip to content

Commit

Permalink
Add a release GHA workflow (#13)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
aurelien-reeves authored Jan 19, 2022
1 parent cb312cf commit eff4591
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/prerelease-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Pre-release checks

on:
workflow_call:

jobs:

check-commit-ancestor:
name: Check commit ancestor
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Check commit has been pushed on origin/main
run: |
git fetch --quiet origin main
git merge-base --is-ancestor HEAD origin/main
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release npm module

on:
push:
branches:
- release/*

jobs:

pre-release-check:
uses: cucumber/cucumber-react/.github/workflows/prerelease-checks.yml@add-release-workflow

test:
uses: cucumber/cucumber-react/.github/workflows/test.yml@add-release-workflow

publish-npm:
name: Publish NPM module
needs: [pre-release-check, test]
runs-on: ubuntu-latest
environment: Release

steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
cache-dependency-path: package-lock.json

- run: npm install-ci-test

- run: npm run compile

- uses: cucumber/[email protected]
with:
npm-token: ${{ secrets.NPM_TOKEN }}

create-github-release:
name: Create GitHub Release and Git tag
needs: [publish-npm]
runs-on: ubuntu-latest
environment: Release
permissions:
contents: write

steps:
- uses: actions/checkout@v2
- uses: cucumber/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
pull_request:
branches:
- main
workflow_call:

jobs:
test:
Expand Down
1 change: 1 addition & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See [.github/RELEASING](https://github.com/cucumber/.github/blob/main/RELEASING.md).

0 comments on commit eff4591

Please sign in to comment.