Skip to content

Commit

Permalink
ci: update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sripwoud committed Jul 10, 2024
1 parent c0f8408 commit 04999d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ on:
jobs:
npm:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
Expand All @@ -43,12 +42,12 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# TODO: uncomment
# run: yarn changelogithub
# env:
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- run: yarn changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

forge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: fregante/[email protected]
Expand Down
13 changes: 7 additions & 6 deletions scripts/publish-for-forge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,26 @@ clean() {
maybe_publish_forge_pkg() {
pkg="$1"
version=$(jq -r '.version' "packages/$pkg/package.json")
current_branch=$(git branch --show-current)
latest_commit_msg=$(git log -1 --pretty=%B)

git checkout -b "$pkg"
# return early if latest already published
[ "$latest_commit_msg" = "$version" ] && return
git status
git pull --rebase origin "$pkg"
git pull --rebase origin "$pkg" 2>/dev/null || true
clean "$pkg"
mv "packages/$pkg"/src .
mv "packages/$pkg"/README.md .
mkdir "$pkg"
mv "packages/$pkg"/src "$pkg"
mv "packages/$pkg"/README.md "$pkg"
mv LICENSE "$pkg"
rm -fr "packages"
git add src
git commit -am "$version"
git push origin "$pkg"
git checkout "$current_branch"
git checkout origin/"$GITHUB_HEAD_REF"
}

main() {
git fetch origin "$GITHUB_HEAD_REF"
# http://mywiki.wooledge.org/BashFAQ/001
# https://github.com/koalaman/shellcheck/wiki/SC2012
find packages -maxdepth 1 -mindepth 1 -printf '%P\n' | while read -r pkg; do
Expand Down

0 comments on commit 04999d9

Please sign in to comment.