Skip to content

chore(ci): update actions versions #14

chore(ci): update actions versions

chore(ci): update actions versions #14

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
mode:
description: "Release mode"
required: true
default: "no publish"
type: choice
options:
- "no publish"
- "publish"
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Install Dependencies
run: npm ci
- name: Get Package Version
id: package-version
uses: martinbeentjes/[email protected]
- name: No Publish Build and Pack
if: ${{ github.event_name == 'workflow_dispatch' && inputs.mode == 'no publish' }}
run: |
npm run build
npm pack
- name: No Publish Artifact Upload
if: ${{ github.event_name == 'workflow_dispatch' && inputs.mode == 'no publish' }}
uses: actions/upload-artifact@v4
with:
name: package-artifact
path: prettier-plugin-embed-${{steps.package-version.outputs.current-version}}.tgz
retention-days: 1
overwrite: true
- name: Create Release Pull Request or Publish to npm
if: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.mode == 'publish') }}
id: changesets
uses: changesets/action@v1
with:
publish: npx changeset publish
commit: "chore(release): v${{steps.package-version.outputs.current-version}}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}