Skip to content

toml package needs more metadata for publishing (#342) #267

toml package needs more metadata for publishing (#342)

toml package needs more metadata for publishing (#342) #267

name: covector version or publish
on:
push:
branches:
- main
permissions:
# required for npm provenance
id-token: write
# required to create the GitHub Release
contents: write
jobs:
covector:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: volta-cli/action@v4
- uses: actions/setup-node@v3
with:
registry-url: "https://registry.npmjs.org"
- name: git config
run: |
git config --global user.name "${{ github.event.pusher.name }}"
git config --global user.email "${{ github.event.pusher.email }}"
- run: npm ci --ignore-scripts
- run: npm run build
- run: npm run pkg -w action
- name: covector version-or-publish
uses: ./packages/action
id: covector
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
command: "version-or-publish"
createRelease: true
recognizeContributors: true
- name: dump covector output
env:
COVECTOR_CONTEXT: ${{ toJson(steps.covector) }}
run: echo "$COVECTOR_CONTEXT"
- name: sync lockfile
if: steps.covector.outputs.commandRan == 'version'
run: npm install
- name: create pull request
id: cpr
uses: peter-evans/create-pull-request@v6
if: steps.covector.outputs.commandRan == 'version'
with:
title: "Publish New Versions"
commit-message: "publish new versions"
labels: "version updates, preview"
branch: "release"
body: ${{ steps.covector.outputs.change }}