Skip to content

Commit

Permalink
Add publishing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JackWilb committed Aug 26, 2022
1 parent d420845 commit 0702182
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
pull_request:
push:
# Run CI on all branch pushes. Must use this syntax,
# as we also need to run CI on tag pushes.
branches:
- "**"
tags:
- v[0-9]+.[0-9]+.[0-9]+*

jobs:
build:
name: Build, lint, and publish
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3

- name: Set up Node environment
uses: actions/setup-node@v3
with:
node-version: '16'
cache: yarn

- name: Create a production build
run: yarn build

- name: Get the publishing version number
id: version-number
run: echo "::set-output name=version::$(git describe --tags | tail -c +2)"
if: startsWith(github.ref, 'refs/tags/')

- name: Publish the package
run: yarn publish --new-version ${{ steps.version-number.outputs.version }} --non-interactive --no-git-tag-version
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')

0 comments on commit 0702182

Please sign in to comment.