Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Commit

Permalink
feat(gh): add release workflow for Github Actions (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
KalleV committed Jun 3, 2021
1 parent 8d32a45 commit 51387b8
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release
on:
push:
branches:
- 2x
jobs:
release:
name: Release
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
# Semantic Release uses a separate Github Token for publishing
# See: https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/github-actions.md#pushing-packagejson-changes-to-a-master-branch
persist-credentials: false
- uses: mstachniuk/ci-skip@v1
# Cancels the pipeline early if [ci skip] is detected in the commit header.
# For example, changelog commits from the Semantic Release toolchain will generate a commit with the [ci skip] in the header.
with:
fail-fast: true
- name: Configure CI Github User
run: |
git config --global user.name 'LabShare'
git config --global user.email 'LabShare@labshare.org'
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14
- name: Install dependencies
# Skip post-install scripts here, as a malicious
# script could steal NODE_AUTH_TOKEN.
run: npm i --ignore-scripts
- name: Build
# `npm rebuild` will run all those post-install scripts for us.
run: |
npm rebuild
npm run build
- name: Release
# Semantic release's NPM plugin generates a local .npmrc file based on the "NPM_TOKEN" environment variable.
# See: https://github.com/semantic-release/npm/blob/87e82694652ce0dee71773d39d450645f0350074/lib/set-npmrc-auth.js#L27
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: npm run semantic-release

0 comments on commit 51387b8

Please sign in to comment.