Skip to content

Merge pull request #9 from brainylab/changeset-release/beta #35

Merge pull request #9 from brainylab/changeset-release/beta

Merge pull request #9 from brainylab/changeset-release/beta #35

Workflow file for this run

name: Release
on:
push:
branches:
- beta
permissions:
contents: write
id-token: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
release-npm:
name: Release to NPM
runs-on: ubuntu-latest
steps:
- name: checkout branch
uses: actions/checkout@v4
- name: install and configure git
uses: ./.github/common-actions/install
- name: build packages
run: pnpm build
- name: test
run: pnpm test
- name: npm package registry authentication
run: npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: create release pull request or publish to NPM
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
title: 'ci(changesets): :package: version packages'
commit: 'ci(changesets): version packages'
setupGitUser: false
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: sync files from beta to main branch if a publish happens
if: steps.changesets.outputs.published == 'true'
run: |
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/brainylab/resolver-validators/dispatches \
-d '{"event_type":"sync-beta-to-main"}'
release-grp:
name: Release to GRP
runs-on: ubuntu-latest
needs: release-npm
steps:
- name: checkout branch
uses: actions/checkout@v4
- name: Git fetch tags
run: git fetch --tags origin
- name: install and configure git
uses: ./.github/common-actions/install
- name: build packages
run: pnpm build
- name: tests
run: pnpm test
- name: get package registry GRP
run: npm config set registry https://npm.pkg.github.com
- name: github package registry authentication
run: npm set //npm.pkg.github.com/:_authToken=${{ secrets.GHP_PACKAGES_TOKEN }}
- name: publish packages on GRP
run: pnpm run release