hardlounge/.github/workflows/release.yml

56 lines
1.2 KiB
YAML
Raw Normal View History

2019-11-18 16:28:26 +00:00
name: Release
permissions:
contents: read
id-token: write
2019-11-18 16:28:26 +00:00
on:
push:
tags: v*
jobs:
release:
name: Release workflow
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup Node.js
uses: actions/setup-node@v3
2019-11-18 16:28:26 +00:00
with:
registry-url: "https://registry.npmjs.org/"
- name: Install
run: yarn --frozen-lockfile --non-interactive
- name: Build
run: yarn build
env:
NODE_ENV: production
- name: Test
run: yarn test
- name: Update npm
run: npm install -g npm
2019-11-18 16:28:26 +00:00
- name: Publish latest
if: "!contains(github.ref, '-')"
run: npm publish --tag latest --provenance
2019-11-18 16:28:26 +00:00
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
- name: Publish next
if: contains(github.ref, '-')
run: npm publish --tag next --provenance
2019-11-18 16:28:26 +00:00
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
- name: Remove next tag
if: "!contains(github.ref, '-')"
run: npm dist-tag rm thelounge next || true
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}