-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add prepare-release.yml * update changelog * fix replacement * fix current version extraction * add autocommit * fix autocommit * exclude package-lock and releasing from bump * fix exclusion * Update .github/workflows/prepare-release.yml * remove unused step ids * Update RELEASING.md Co-authored-by: Andrew Fleming <[email protected]> * Update .github/workflows/prepare-release.yml Co-authored-by: Nikita Stupin <[email protected]> * add GH_PAT to workflow * update secret name * update secret name * update secret name * fix PAT setting * Update .github/workflows/prepare-release.yml Co-authored-by: Andrew Fleming <[email protected]> --------- Co-authored-by: Andrew Fleming <[email protected]> Co-authored-by: Nikita Stupin <[email protected]>
- Loading branch information
1 parent
3baa102
commit 43ca5cd
Showing
3 changed files
with
41 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Update version on new release branch | ||
|
||
on: | ||
create: | ||
|
||
jobs: | ||
update_version: | ||
if: github.ref_type == 'branch' && startsWith(github.ref, 'refs/heads/release-v') | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.OPENZEPPELIN_ORG_GITHUB_PAT }} | ||
|
||
- name: Extract current version | ||
run: | | ||
CURRENT_VERSION=$(grep '^version = ' Scarb.toml | sed 's/version = "\(.*\)"/\1/') | ||
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV | ||
- name: Extract new version number | ||
run: echo "NEW_VERSION=${GITHUB_REF#refs/heads/release-v}" >> $GITHUB_ENV | ||
|
||
- name: Replace version in files | ||
run: | | ||
echo "Current version: $CURRENT_VERSION" | ||
echo "New version: $NEW_VERSION" | ||
find . -type f -not -path '*/\.*' -not -path './CHANGELOG.md' -not -path './docs/package-lock.json' -not -path './RELEASING.md' -exec sed -i "s/$CURRENT_VERSION/$NEW_VERSION/g" {} + | ||
- name: Auto-commit changes | ||
uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a #v4.16.0 | ||
with: | ||
commit_message: Bump version to ${{ env.NEW_VERSION }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters