Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a release GHA workflow #13

Merged
merged 6 commits into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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).