Merge pull request #14 from freitas-labs/changeset-release/master #34
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 to GitHub | |
on: | |
push: | |
branches: | |
- 'master' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up npm | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
cache: 'npm' | |
- name: Install npm | |
run: npm install --frozen-lockfile | |
- name: Create Release Pull Request or Publish | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
publish: bash scripts/release.sh | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Print outputs | |
run: | | |
echo "${{ steps.changesets.outputs }}" | |
- name: Zip dist folder | |
id: zip-folder | |
if: steps.changesets.outputs.published == 'true' | |
uses: vimtor/action-zip@v1 | |
with: | |
files: dist | |
dest: dist.zip | |
- name: After Zipping dist folder | |
if: steps.zip-folder.outcome == 'success' | |
uses: actions/upload-artifact@v1 | |
with: | |
name: my-artifact | |
path: ${{ github.workspace }}/dist.zip |