From 6cd84068ce1f4e0c9a701ceac6baa67a468365f1 Mon Sep 17 00:00:00 2001 From: trydofor Date: Mon, 21 Oct 2024 15:01:53 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20dummy=20release=20to=20test=20wo?= =?UTF-8?q?rkflows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/angry-starfishes-clap.md | 6 +++++ .changeset/publish-all.sh | 14 +++++++++++ .changeset/{bump-top.sh => version-top.sh} | 1 + .github/workflows/release.yml | 28 ++++++++++------------ layers/common/package.json | 2 +- layers/mobile/package.json | 2 +- package.json | 2 +- 7 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 .changeset/angry-starfishes-clap.md create mode 100755 .changeset/publish-all.sh rename .changeset/{bump-top.sh => version-top.sh} (91%) diff --git a/.changeset/angry-starfishes-clap.md b/.changeset/angry-starfishes-clap.md new file mode 100644 index 0000000..857bec8 --- /dev/null +++ b/.changeset/angry-starfishes-clap.md @@ -0,0 +1,6 @@ +--- +"@fessional/razor-common": patch +"@fessional/razor-mobile": patch +--- + +💚 dummy release to test workflows diff --git a/.changeset/publish-all.sh b/.changeset/publish-all.sh new file mode 100755 index 0000000..ac6ab9e --- /dev/null +++ b/.changeset/publish-all.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +## changeset publish +## Tagging and releasing each package is too much + +set -x -e +# pnpm -r publish --access public --report-summary --dry-run --no-git-checks +pnpm -r publish --access public --report-summary + +## simulate https://github.com/changesets/action/blob/31ff97e8acd3cfd08714eab3721f55da10003255/src/run.ts#L139 +## 🦋 New tag: @fessional/razor-mobile@0.1.24 +jq -r '.publishedPackages[] | select(.name != "@fessional/razor") | "🦋 New tag: \(.name)\(@\(.version))"' pnpm-publish-summary.json + +rm -rf pnpm-publish-summary.json diff --git a/.changeset/bump-top.sh b/.changeset/version-top.sh similarity index 91% rename from .changeset/bump-top.sh rename to .changeset/version-top.sh index 8e2c9aa..17fbb5e 100755 --- a/.changeset/bump-top.sh +++ b/.changeset/version-top.sh @@ -4,6 +4,7 @@ set -x -e pnpm exec changeset status --output version-status.tmp newv=$(jq -r '.releases[1].newVersion' version-status.tmp) +## replace version in package.json if [[ "$(uname)" == "Darwin" ]]; then sed -i '' "s/\"version\": \".*\"/\"version\": \"$newv\"/" package.json else diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0838729..02dc168 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,7 +38,7 @@ jobs: - name: Prepare Project run: | - chmod a+x .changeset/bump-top.sh + chmod a+x .changeset/*.sh echo "install pnpm-hoist-layer to devDep" pnpm -w i --no-frozen-lockfile --ignore-pnpmfile echo "reset the ci lockfile" @@ -81,8 +81,8 @@ jobs: with: commit: ":bookmark: bumping versions" title: ":rocket: release versions" - version: .changeset/bump-top.sh - publish: pnpm ver:publish + version: .changeset/version-top.sh + publish: .changeset/publish-all.sh createGithubReleases: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -99,12 +99,18 @@ jobs: echo "| PR Number | ${{ steps.changesets.outputs.pullRequestNumber }} |" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - - name: Publish to Npmjs + - name: Github Release + id: release if: steps.changesets.outputs.published == 'true' - run: | - pnpm publish --access public + uses: halvardssm/github-action-tag-release@1.0.4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + path: "./package.json" - echo "## Publishing Report" >> $GITHUB_STEP_SUMMARY + - name: Publish Status + if: steps.changesets.outputs.published == 'true' + run: | + echo "## Publish Status" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "| Package | Version |" >> $GITHUB_STEP_SUMMARY echo "|-----------|---------|" >> $GITHUB_STEP_SUMMARY @@ -116,11 +122,3 @@ jobs: echo "| $(echo $pkg | jq -r '.name') | $(echo $pkg | jq -r '.version') |" >> $GITHUB_STEP_SUMMARY done echo "" >> $GITHUB_STEP_SUMMARY - - - name: Github Release - id: release - if: steps.changesets.outputs.published == 'true' - uses: halvardssm/github-action-tag-release@1.0.4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - path: "./package.json" diff --git a/layers/common/package.json b/layers/common/package.json index 8da1907..a48f4da 100644 --- a/layers/common/package.json +++ b/layers/common/package.json @@ -1,7 +1,7 @@ { "name": "@fessional/razor-common", "type": "module", - "version": "0.1.24", + "version": "0.1.26", "description": "common layer for mobile and desktop", "main": "./nuxt.config.ts", "types": "./index.d.ts", diff --git a/layers/mobile/package.json b/layers/mobile/package.json index c7b09eb..7cd5a2b 100644 --- a/layers/mobile/package.json +++ b/layers/mobile/package.json @@ -1,7 +1,7 @@ { "name": "@fessional/razor-mobile", "type": "module", - "version": "0.1.24", + "version": "0.1.26", "description": "mobile layer with ionic and capacitor", "main": "./nuxt.config.ts", "scripts": { diff --git a/package.json b/package.json index 8af8b2c..84463f2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@fessional/razor", "type": "module", - "version": "0.1.24", + "version": "0.1.26", "description": "Use front-end tech (Nuxt/Ts) to build multi-platform from one codebase, suitable for small team and app to write app once, apply almost anywhere.", "packageManager": "pnpm@9.9.0", "engines": {