Merge pull request #65 from bernardarhia/changeset-release/master #94
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: Publish | |
on: | |
release: | |
types: | |
- created | |
push: | |
branches: | |
- "master" | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
publish: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
cache: "npm" | |
- run: npm install --frozen-lockfile | |
- name: Create Release Pull Request or Publish | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
publish: "npm run release" # Modify this to the correct npm release script | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Add the GITHUB_TOKEN to the environment variables | |
- name: Check if Changeset was published | |
run: | | |
if [ "${{ steps.changesets.outputs.published }}" == "true" ]; then | |
echo "Changeset published!"; | |
else | |
echo "No changeset published."; | |
fi |