Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(github): bump version immediately in publish #410

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/[email protected]
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 }}
2 changes: 2 additions & 0 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Checks

on:
pull_request:
paths-ignore:
- '.github/**'

jobs:
check:
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
name: Publish

on:
workflow_dispatch:
pull_request:
types:
- closed
branches:
- master
paths-ignore:
- '.github/**'

jobs:
run:
Expand Down Expand Up @@ -32,8 +38,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.