Skip to content

Commit

Permalink
Merge pull request #86 from trixtateam/update/ci_semantic_release
Browse files Browse the repository at this point in the history
ci: semantic release and publish
  • Loading branch information
jacqueswho committed Dec 15, 2022
2 parents 36287db + 80fd50c commit 6c2b306
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 1,622 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ name: publish-npm
# Controls when the workflow will run
on:
workflow_dispatch:
workflow_run:
workflows: ["semantic-release"]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
Expand Down
50 changes: 39 additions & 11 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

jobs:
semantic-release:
semantic-release-version:
name: Running semantic-release
if: "!contains(toJSON(github.event.commits.*.message), 'chore(release):')"
runs-on: ubuntu-latest
Expand All @@ -21,13 +21,6 @@ jobs:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}

- name: Configure npm 🔑
run: |
echo "//npm.pkg.github.com/:_authToken=$GH_TOKEN" > .npmrc
echo '@trixtateam:registry=https://npm.pkg.github.com' >> .npmrc
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}

- name: 💿 Setup Nodejs
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -65,11 +58,46 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
publish-packages:
name: Publishing packages
needs: semantic-release-version
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
CI: true
steps:
- name: 🛒 Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}

- name: 🚀 Publish packages
continue-on-error: true
run: yarn publish:libs
- name: 🚀 Publish package to GitHub Packages
uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://npm.pkg.github.com'
# Defaults to the user or organization that owns the workflow file
scope: '@trixtateam'
- run: yarn
- run: yarn publish:libs
env:
NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }}
- if: always()
run: rm .npmrc

- name: 🚀 Publish package to NPM Registry
uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
# Defaults to the user or organization that owns the workflow file
scope: '@trixtateam'
- run: yarn
- run: yarn publish:libs
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- if: always()
run: rm .npmrc
2 changes: 1 addition & 1 deletion packages/core/release.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = {
],
'@semantic-release/release-notes-generator',
'@semantic-release/changelog',
['@semantic-release/npm', { npmPublish: true, }],
['@semantic-release/npm', { npmPublish: false, }],
[
'@semantic-release/git',
{
Expand Down
2 changes: 1 addition & 1 deletion packages/rjsf/release.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = {
],
'@semantic-release/release-notes-generator',
'@semantic-release/changelog',
['@semantic-release/npm', { npmPublish: true, }],
['@semantic-release/npm', { npmPublish: false, }],
[
'@semantic-release/git',
{
Expand Down
Loading

0 comments on commit 6c2b306

Please sign in to comment.