-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
321dc5b
commit d668f6d
Showing
6 changed files
with
136 additions
and
29 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Create Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
if: github.event.head_commit.message =~ '^v\d.\d.\d$' | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@master | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.event.head_commit.message }} | ||
release_name: ${{ github.event.head_commit.message }} | ||
draft: false | ||
prerelease: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Renew configs | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
jobs: | ||
check_release: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
skip: ${{ steps.release.outputs.skip }} | ||
version: ${{ steps.gear_release.outputs.version }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Last gear release | ||
id: gear_release | ||
run: | | ||
VERSION=curl -s https://api.github.com/repos/gear-tech/gear/releases/latest | jq -r '.tag_name' | ||
echo "version=VERSION" >> $GITHUB_OUTPUT | ||
- name: Last rosetta release | ||
id: rosetta_release | ||
run: | | ||
VERSION=curl -s https://api.github.com/repos/gear-foundation/integrations-rosetta-api/releases/latest | jq -r '.tag_name' | ||
echo "version=VERSION" >> $GITHUB_OUTPUT | ||
- name: Compare versions | ||
id: release | ||
run: | | ||
if [ ${{ steps.gear_release.outputs.version }} == ${{ steps.rosetta_release.outputs.version }} ]; then | ||
echo "No new version to release" | ||
echo "skip=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "New version to release" | ||
echo "skip=false" >> $GITHUB_OUTPUT | ||
fi | ||
create_pr: | ||
runs-on: ubuntu-latest | ||
needs: check-release | ||
if: needs.check_release.outputs.skip != 'true' | ||
env: | ||
VERSION: ${{ needs.check_release.outputs.version }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: "Install NodeJS 20.x" | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.x | ||
|
||
- name: "Update metadata" | ||
run: | | ||
node ./scripts/renew-config.js ${{ needs.check_release.outputs.version }} | ||
- name: New PR branch | ||
id: new-branch | ||
run: | | ||
NAME="$BRANCH_PREFIX-${{ github.event.inputs.tag }}" | ||
echo "name=$NAME" >> $GITHUB_OUTPUT | ||
- name: Create Pull Request if not exist | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
commit-message: add new vara config | ||
branch: ${{ steps.new-branch.outputs.name }} | ||
delete-branch: true | ||
base: master | ||
title: "[Automated] ${{ needs.check_release.outputs.version }}" | ||
add-paths: | | ||
config/* | ||
body: | | ||
"Automated renew configs for version ${{ needs.check_release.outputs.version }}" | ||
draft: false | ||
reviewers: osipov-mit |
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