Skip to content

release: 0.3.0

release: 0.3.0 #6

Workflow file for this run

# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: publish
on:
workflow_dispatch:
inputs:
version:
description: ""
required: true
default: "keep current"
type: choice
options:
- "keep current"
push:
tags:
- "v*.*.*"
env:
default_node_version: "lts/*"
jobs:
build:
name: Build
uses: ./.github/workflows/build.yml
publish-npm:
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions/download-artifact@v4
with:
name: artifact
- uses: actions/setup-node@v4
with:
# node-version: "lts/*"
registry-url: https://registry.npmjs.org/
- run: npm publish --provenance --access public --registry=https://registry.npmjs.org/
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
publish-ghp:
needs: build
runs-on: ubuntu-latest
env:
SCOPE: "@${{github.repository_owner}}"
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions/setup-node@v4
with:
# node-version: "lts/*"
registry-url: "https://npm.pkg.github.com/"
# Defaults to the user or organization that owns the workflow file
scope: ${{env.SCOPE}}
token: ${{secrets.GITHUB_TOKEN}}
always-auth: true
- uses: actions/download-artifact@v4
with:
name: artifact
- name: rename package name
run: |
node scripts/renamePackage.mjs
- run: npm publish --access public --registry=https://npm.pkg.github.com
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
release:
name: Release
needs: publish-npm
runs-on: ubuntu-latest
permissions:
contents: write
discussions: write
steps:
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
generate_release_notes: true
discussion_category_name: "Announcements"