Skip to content

Commit a8f9ddf

Browse files
authored
ci: automate release process (#304)
1 parent 18c529a commit a8f9ddf

4 files changed

Lines changed: 10369 additions & 4209 deletions

File tree

.github/workflows/node.js.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,35 @@ jobs:
7272
if: matrix.report-coverage
7373
with:
7474
github-token: ${{ secrets.GITHUB_TOKEN }}
75+
76+
release:
77+
# https://github.community/t/github-actions-does-not-respect-skip-ci/17325/9
78+
if: "github.event_name == 'push' && !contains(github.event.head_commit.message, '[skip ci]')"
79+
runs-on: ubuntu-latest
80+
81+
needs: [test]
82+
83+
steps:
84+
- uses: actions/checkout@v2
85+
with:
86+
# Necessary to prevent the checkout action from writing credentials to .git/config, which
87+
# semantic-release attempts to use to push despite those credentials being denied the
88+
# push.
89+
# See https://github.com/semantic-release/git/issues/196#issuecomment-601310576.
90+
persist-credentials: false
91+
- name: Use Node.js 14.x
92+
uses: actions/setup-node@v1
93+
with:
94+
node-version: 14.x
95+
- name: Restore dependencies
96+
id: cache
97+
uses: actions/cache@v2
98+
with:
99+
path: node_modules
100+
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}
101+
- name: Release
102+
run: npx --no-install semantic-release
103+
env:
104+
# Need to use a separate token so we can push to the protected default branch.
105+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
106+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)