Skip to content

Merge pull request #1217 from openameba/feature/add-dist-dir #205

Merge pull request #1217 from openameba/feature/add-dist-dir

Merge pull request #1217 from openameba/feature/add-dist-dir #205

Workflow file for this run

name: releaseing
on:
push:
branches:
- release/major
- release/minor
- release/patch
- release/premajor
- release/preminor
- release/prepatch
- release/prerelease
jobs:
releaseing:
name: releaseing
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: restore lerna
uses: actions/cache@v4
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-v2
- run: npm install -g npm@9
- run: yarn install --frozen-lockfile
- run: yarn lerna run --scope @openameba/spindle-hooks build
- name: Set git user
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
- name: Extract branch from git ref
run: |
echo "::set-output name=name::${GITHUB_REF#refs/*/}"
echo "::set-output name=version::${GITHUB_REF##*/}"
id: extract_branch
- name: Releaseing with lerna
# also see some options in lerna.json
run: yarn lerna publish ${{ steps.extract_branch.outputs.version }} --conventional-commits --create-release github --yes --no-private
env:
GH_TOKEN: ${{ github.token }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
- name: Create Pull Request
run: >
curl
-X POST
-H "Accept: application/vnd.github.v3+json"
-H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}"
https://api.github.com/repos/${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}/pulls
-d '{"head":"${{ steps.extract_branch.outputs.name }}","base":"${{ github.event.repository.default_branch }}","title":"chore: publish"}'