Skip to content

Commit

Permalink
Feature/4 npm deployment (#16)
Browse files Browse the repository at this point in the history
* [#4] Push via PR

* [#4] release on main branch

* [#4] Update CI

* [#4] Add git pull in CI

* [#4] Update CI release

* [#4] Update deprecated set-output
  • Loading branch information
dedenbangkit authored Jul 25, 2024
1 parent 8f3ba36 commit 2b07c5a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,32 +47,33 @@ jobs:
id: bump_version
run: |
NEW_VERSION=$(yarn version --patch --no-git-tag-version | grep 'New version' | awk '{print $NF}')
echo "::set-output name=new_version::$NEW_VERSION"
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
- name: Commit version bump
env:
GPG_TTY: ${{ env.GPG_TTY }}
PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
NEW_VERSION: ${{ env.NEW_VERSION }}
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
git checkout -b release-branch || git checkout release-branch
git pull origin release-branch --rebase
git add package.json
echo "$PASSPHRASE" | gpg --batch --yes --passphrase-fd 0 --pinentry-mode loopback --sign
git commit -S -m "chore(release): ${{ steps.bump_version.outputs.new_version }}"
git commit -S -m "chore(release): $NEW_VERSION"
git push origin release-branch --force
- name: Create Pull Request
id: create_pr
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'chore(release): ${{ steps.bump_version.outputs.new_version }}'
commit-message: 'chore(release): ${{ env.NEW_VERSION }}'
base: main
branch: release-branch
title: 'Release ${{ steps.bump_version.outputs.new_version }}'
body: 'Automated release of version ${{ steps.bump_version.outputs.new_version }}'
title: 'Release ${{ env.NEW_VERSION }}'
body: 'Automated release of version ${{ env.NEW_VERSION }}'

- name: Build the project
if: github.event_name == 'pull_request'
Expand Down

0 comments on commit 2b07c5a

Please sign in to comment.