thelounge/.github/workflows/release.yml
Max Leiter a55dc206bb Replace yarn with pnpm
It's time to move on from yarn 1, imo.
Not that I contribute enough to care, but it was frustrating to use yarn
while setting my local repo up again.
2024-01-27 15:55:34 -08:00

60 lines
1.2 KiB
YAML

name: Release
permissions:
contents: read
id-token: write
on:
push:
tags: v*
jobs:
release:
name: Release workflow
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node.js
uses: actions/setup-node@v4
with:
registry-url: "https://registry.npmjs.org/"
- name: Install
run: pnpm --frozen-lockfile
- name: Build
run: pnpm build
env:
NODE_ENV: production
- name: Test
run: pnpm test
- name: Update npm
run: npm install -g npm
- name: Publish latest
if: "!contains(github.ref, '-')"
run: npm publish --tag latest --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
- name: Publish next
if: contains(github.ref, '-')
run: npm publish --tag next --provenance
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 }}