Skip to content

Commit

Permalink
πŸ’Ύ saving work
Browse files Browse the repository at this point in the history
  • Loading branch information
zrosenbauer committed Dec 12, 2024
1 parent 67e3978 commit 61c12ec
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-release-notes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
update_draft_release:
runs-on: ubuntu-latest
steps:
- uses: toolmantim/release-drafter@v6
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: 'πŸ’š Use Node.js'
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
- name: 'πŸ“¦ Install Packages'
run: yarn install
- name: 'πŸ•΅οΈ Code Linting & Formatting'
Expand Down
58 changes: 31 additions & 27 deletions .github/workflows/pkg-npm-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,49 @@
name: 'pkg: Publish to npm'
run-name: 'Publish to npm Registry (${{ inputs.version }})'
name: 'pkgs: Publish to internal npm registry'
run-name: 'Publish to GitHub npm Registry (${{ inputs.version }})'

on:
workflow_dispatch:
inputs:
version:
description: 'Semantic Version'
required: true
default: 'prerelease'
type: choice
options:
- patch
- minor
- major
- prerelease

jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
name: 'Publish to GitHub npm Registry'
runs-on: ubuntu-latest-4-cores
timeout-minutes: 15
steps:
- name: 'πŸ›’ Checkout Code'
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_BOT_TOKEN }}

- name: '🟒 Use Node.js'
- name: "𝌀 Enable Corepack"
run: corepack enable

- name: '🟒 Setup Node.js'
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
registry-url: 'https://npm.pkg.github.com'
token: ${{ secrets.GH_BOT_TOKEN }}
scope: '@joggrdocs'
cache: 'yarn'

- name: 'πŸ“¦ Install packages'
run: yarn install

- name: 'πŸ—οΈ Build'
run: yarn build

- name: 'πŸ”Ό Increment Version'
run: yarn version ${{ inputs.version }}
# We have to run with npm because yarn's update is based on "stableVersion" which is not what we want
run: yarn workspaces foreach --all exec npm version --no-git-tag-version --no-workspaces-update ${{ inputs.version }}

- name: '#️⃣ Get Version'
uses: actions/github-script@v7
Expand All @@ -48,31 +54,29 @@ jobs:
script: |
const fs = require('fs');
const pj = JSON.parse(fs.readFileSync('${{ github.workspace }}/package.json'));
return pj.version;
return pj.version;
- name: 'πŸ—οΈ Build'
run: yarn turbo run build --filter="./packages/*"

- name: '🧢 Setup .yarnrc.yml'
run: 'yarn config set npmScopes.joggrdocs.npmAuthToken ${{ secrets.GH_BOT_TOKEN }}'

- name: '🚒 Publish'
run: yarn workspaces foreach -A --include "packages/*" npm publish --tolerate-republish --access restricted

- name: 'πŸ’Ύ Commit Incremented Version'
run: |
git config --local user.email "${{ secrets.GH_BOT_EMAIL }}"
git config --local user.name "${{ secrets.GH_BOT_NAME }}"
git add package.json
git commit -am "[πŸ€– release]: ${{ steps.version.outputs.result }} (${{ inputs.version }})"
git add ./packages/*/package.json ./package.json
git commit -m "[πŸ€– npm-publish]: ${{ steps.version.outputs.result }} (${{ inputs.version }}) [skip-ci]"
git push origin HEAD --force
- name: 'πŸ“ Generate Release Notes (user-input)'
uses: toolmantim/release-drafter@v6
- name: 'πŸ“ Publish Release Notes'
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: v${{ steps.version.outputs.result }}
publish: true

- name: Setup .yarnrc.yml
run: |
yarn config set npmScopes.joggr.npmRegistryServer "https://registry.npmjs.org"
yarn config set npmScopes.joggr.npmAlwaysAuth true
yarn config set npmScopes.joggr.npmAuthToken $NPM_AUTH_TOKEN
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH }}

- name: '🚒 Publish'
run: yarn npm publish --access public

0 comments on commit 61c12ec

Please sign in to comment.