Skip to content

bug fixed

bug fixed #16

name: Release Please
on:
push:
branches:
- main
jobs:
release-please:
name: Release
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
published: ${{ steps.set_outputs.outputs.published }}
release: ${{ steps.set_outputs.outputs.release }}
changelog: ${{ steps.set_outputs.outputs.changelog }}
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: node
token: ${{ secrets.GH_ZAPPER_BOT }}
package-name: '@zapper-fi/studio'
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v2
with:
node-version: 'lts/gallium'
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}
- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
if: ${{ steps.release.outputs.release_created }}
- uses: pnpm/[email protected]
with:
version: 7.0.1
run_install: true
if: ${{ steps.release.outputs.release_created }}
- name: Build package
env:
NODE_OPTIONS: '--max_old_space_size=4096'
run: pnpm build
if: ${{ steps.release.outputs.release_created }}
- name: Publish to NPM
working-directory: dist
run: pnpm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ steps.release.outputs.release_created }}
- name: Publish to Github Packages
working-directory: dist
run: |
echo "//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}" > .npmrc
npm config set registry https://npm.pkg.github.com
npm publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ steps.release.outputs.release_created }}
- name: Fetch Release
id: fetch-latest-release
uses: gregziegan/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ steps.release.outputs.release_created }}
- name: Set Outputs
id: set_outputs
run: |
echo "::set-output name=published::${{ steps.release.outputs.release_created }}"
echo "::set-output name=release::${{ steps.fetch-latest-release.outputs.name }}"
echo "::set-output name=changelog::${{ steps.fetch-latest-release.outputs.body }}"
if: ${{ steps.release.outputs.release_created }}
bump-zapper-api:
name: Bump on Zapper API
needs: [release-please]
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.published == 'true' }}
steps:
- uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.GH_ZAPPER_BOT }}
repository: zapper-fi/zapper-api
event-type: bump-studio
client-payload: '{"release": "${{ needs.release-please.outputs.release }}", "changelog": "${{ needs.release-please.outputs.changelog }}"}'