Merge pull request #1234 from gsoft-inc/changeset-release/master #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Changeset | |
on: | |
push: | |
branches: ["master"] | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # required for provenance https://docs.npmjs.com/generating-provenance-statements#publishing-packages-with-provenance-via-github-actions | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout Commit | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: ".nvmrc" | |
- name: Cache yarn dependencies | |
uses: actions/cache@v3 | |
id: cache-dependencies | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.ox }}-yarn- | |
- name: Install Dependencies | |
if: steps.cache-dependencies.outputs.cache-hit != 'true' | |
run: | | |
yarn install --frozen-lockfile | |
- name: Create release Pull Request or publish to NPM | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
commit: "ci(changesets): version packages" | |
title: "Changeset: New Version" | |
# This expects you to have a script called release which does a build for your packages and calls changeset publish | |
publish: npm run release | |
env: | |
NPM_TOKEN: ${{ secrets.SHAREGATE_NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |