Skip to content

Commit

Permalink
fix(github): bump version immediately in publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelfimov committed Sep 9, 2024
1 parent d95cbec commit 73b7464
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 103 deletions.
2 changes: 1 addition & 1 deletion .github/actions/checks/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ runs:
run: |
source .env
export NODE_OPTIONS
yarn workspaces changed foreach --verbose --topological --no-private dlx jsr publish --dry-run
yarn workspaces changed foreach -vtp --no-private dlx jsr publish --dry-run
31 changes: 20 additions & 11 deletions .github/actions/commit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,28 @@ runs:
using: composite

steps:
- name: Get GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ inputs.GITHUB_TOKEN }}
- name: Compose commit message
id: commit_message
run: |
INITIAL_MESSAGE=$'chore(common): versions\n\n'
temp_file=$(mktemp)
yarn workspaces changed foreach exec "echo \"\$npm_package_name:\$npm_package_version \" >> $temp_file"
MESSAGE=$(cat $temp_file)
echo $(cat $temp_file)
INITIAL_MESSAGE+=$MESSAGE
INITIAL_MESSAGE="${INITIAL_MESSAGE//'%'/' '}"
INITIAL_MESSAGE="${INITIAL_MESSAGE//$'\n'/' '}"
INITIAL_MESSAGE="${INITIAL_MESSAGE//$'\r'/' '}"
echo "commitMessage=$INITIAL_MESSAGE" >> $GITHUB_OUTPUT
echo $INITIAL_MESSAGE
rm $temp_file
- name: Commit changes
uses: EndBug/add-and-commit@v9
uses: planetscale/ghcommit-action@v0.1.44
env:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
with:
author_name: ${{ steps.get-user-id.outputs.app-slug }}
author_email: '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
message: ${{ inputs.COMMIT_MESSAGE }}
add: ${{ inputs.PATTERN }}
commit: -S
repo: ${{ github.repository }}
branch: ${{ inputs.BRANCH }}
commit_message: ${{ inputs.COMMIT_MESSAGE }}
file_pattern: ${{ inputs.PATTERN }}
27 changes: 0 additions & 27 deletions .github/actions/lint-typecheck/action.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/actions/publish-jsr/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ runs:
run: |
source .env
export NODE_OPTIONS
yarn workspaces changed foreach --verbose --topological --no-private dlx jsr publish
yarn workspaces changed foreach -vtp --no-private dlx jsr publish
2 changes: 1 addition & 1 deletion .github/actions/publish-npm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ runs:
run: |
source .env
export NODE_OPTIONS
yarn workspaces changed foreach --verbose --topological --no-private npm publish --access public
yarn workspaces changed foreach -vtp --no-private npm publish --access public
env:
YARN_NPM_AUTH_TOKEN: ${{ inputs.NPM_TOKEN }}
12 changes: 0 additions & 12 deletions .github/actions/version-apply/action.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/actions/version/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ runs:
run: |
source .env
export NODE_OPTIONS
yarn workspaces changed foreach --no-private --verbose version patch --deferred
yarn workspaces changed foreach -tpv --no-private version patch -i
env:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
6 changes: 4 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ jobs:
- name: Install
uses: ./.github/actions/install

- name: Apply versions
uses: ./.github/actions/version-apply
- name: Version
uses: ./.github/actions/version
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to NPM
id: npm
Expand Down
47 changes: 0 additions & 47 deletions .github/workflows/version.yaml

This file was deleted.

0 comments on commit 73b7464

Please sign in to comment.