Skip to content

Commit

Permalink
create issue when polkadot release happens (#1045)
Browse files Browse the repository at this point in the history
# Goal
The goal of this PR is to record the latest Polkadot release version in
frequency repo. It will trigger creating a new GitHub issue later in a
different workflow.

Part of #930
  • Loading branch information
demisx committed Feb 9, 2023
1 parent b43741e commit c6cb240
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/.polkadot-latest-full-release.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.9.37
v0.9.36
1 change: 1 addition & 0 deletions .github/workflows/misc/polkadot-latest-full-release.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v0.9.37
40 changes: 40 additions & 0 deletions .github/workflows/track-polkadot-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Track Polkadot Releases
on:
schedule:
- cron: "*/5 * * * *"
env:
REPO_URL: https://api.github.com/repos/paritytech/polkadot
RELEASE_TRACK_FILENAME: .github/workflows/.polkadot-latest-full-release.txt
jobs:
record-polkadot-latest-release-version:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
ref: main
token: ${{secrets.FREQUENCY_REPO_TRACK_POLKADOT_RELEASES}}
- name: Print Recorded Latest Polkadot Release
run: |
echo "Recorded Polkadot Latest Full Release:"
echo "--------------------------------------"
cat ${{env.RELEASE_TRACK_FILENAME}}
- name: Fetch Latest Release Version
run: |
curl -sL $REPO_URL/releases/latest | \
jq -r ".tag_name" > ${{env.RELEASE_TRACK_FILENAME}}
echo "Fetched Polkadot Latest Full Release:"
echo "-------------------------------------"
cat ${{env.RELEASE_TRACK_FILENAME}}
- name: Check for Modified Files
id: git-check
run: |
set -x
modified=$([ -z "`git status --porcelain`" ] && echo "false" || echo "true")
echo "repo_modified=$modified" >> $GITHUB_OUTPUT
- name: Commit latest release version
if: steps.git-check.outputs.repo_modified == 'true'
run: |
git config --global user.name 'Frequency CI'
git config --global user.email '[email protected]'
git commit -am "Record new Polkadot release version"
git push origin

0 comments on commit c6cb240

Please sign in to comment.