Fix typo on variable name (#25) #16
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: Release | |
on: | |
push: | |
branches: | |
- main | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
outputs: | |
published: ${{ steps.release.outputs.published }} | |
publishedPackages: ${{ steps.release.outputs.publishedPackages }} | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup yarn | |
run: corepack enable | |
- name: Setup Node.js environment | |
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3 | |
with: | |
node-version-file: '.node-version' | |
cache: 'yarn' | |
cache-dependency-path: "yarn.lock" | |
- name: Install Dependencies | |
run: yarn | |
- name: Create Release Pull Request or Tag | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
version: yarn run version | |
publish: yarn run release | |
commit: 'ci(changesets): version packages' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Release output | |
id: release | |
run: | | |
# intermediate variable necessary to avoid quotes around the array | |
# that prevented the fromJson function to work correctly | |
publishedPackages=${{toJSON(steps.changesets.outputs.publishedPackages)}} | |
echo 'published=${{steps.changesets.outputs.published}}' >> "$GITHUB_OUTPUT" | |
echo "publishedPackages=$publishedPackages" >> "$GITHUB_OUTPUT" | |
publish: | |
name: Publish | |
needs: [release] | |
if: needs.release.outputs.published == 'true' | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
strategy: | |
matrix: | |
package: ${{ fromJson(needs.release.outputs.publishedPackages) }} | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
with: | |
fetch-depth: 0 | |
- name: Create release | |
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1 | |
with: | |
draft: false | |
tag_name: ${{ matrix.package.name }}@${{ matrix.package.version }} | |
generate_release_notes: true |