From f389e93dbe46b2c181054137bd137814ce2f798a Mon Sep 17 00:00:00 2001 From: Lenz Weber-Tronic Date: Mon, 25 Mar 2024 11:17:31 +0100 Subject: [PATCH] Publish: commit directly --- .github/workflows/publish.yml | 44 +++++++++++------------------------ 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bad40749..7657e9f1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,19 +25,17 @@ jobs: steps: # Create an access token for the Github Actions Bot app. This one has permissions # to push directly to this repository (only!) without required status checks. - # - uses: actions/create-github-app-token@v1 - # id: github-actions-bot-app-token - # with: - # app-id: 48725422 - # private-key: ${{ secrets.APOLLO_GITHUB_ACTIONS_BOT_PRIVATE_KEY }} - # repositories: ${{ github.repository }} - # owner: ${{ github.repository_owner }} + - uses: actions/create-github-app-token@v1 + id: github-actions-bot-app-token + with: + app-id: 819772 + private-key: ${{ secrets.APOLLO_GITHUB_ACTIONS_BOT_PRIVATE_KEY }} # Check out the repository, using the Github Actions Bot app's token so that we # can push later and override required statuses. - uses: actions/checkout@v4 - # with: - # token: ${{ steps.github-actions-bot-app-token.outputs.token }} + with: + token: ${{ steps.github-actions-bot-app-token.outputs.token }} - uses: actions/setup-node@v4 with: @@ -56,19 +54,13 @@ jobs: yarn workspace @apollo/experimental-nextjs-app-support exec npm pkg set "dependencies[@apollo/client-react-streaming]=${{ inputs.version }}" "version=${{ inputs.version }}" yarn workspace @apollo/experimental-nextjs-app-support exec jq '{ version: .version, dependencies: .dependencies, peerDependencies: .peerDependencies }' package.json - # - name: Commit changes back - # uses: stefanzweifel/git-auto-commit-action@v5 - # with: - # commit_message: "Bump version to ${{ inputs.version }}" - # push_options: "" - # skip_dirty_check: false - # tagging_message: "v.${{ inputs.version }}" - - name: Create commit - run: | - git config user.name ${{ github.actor }} - git config user.email ${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com - git add --all - git commit -m "Bump version to ${{ inputs.version }}" + - name: Commit changes back + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "Release version ${{ inputs.version }}@${{ inputs.tag}} to npm" + push_options: "" + skip_dirty_check: false + tagging_message: "v.${{ inputs.version }}" - name: "@apollo/client-react-streaming: publish" run: yarn workspace @apollo/client-react-streaming exec npm publish --access public --tag ${{ inputs.tag }} --provenance @@ -79,11 +71,3 @@ jobs: run: yarn workspace @apollo/experimental-nextjs-app-support exec npm publish --access public --tag ${{ inputs.tag }} --provenance env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v6 - with: - title: "Bump version to ${{ inputs.version }}" - branch: "pr/bump-version" - branch-suffix: short-commit-hash - delete-branch: true