-
Notifications
You must be signed in to change notification settings - Fork 6
48 lines (42 loc) · 1.4 KB
/
release-devnet-chainspec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# checks if there are changes in the chainspec file and makes a new github
# release of the chainspec if any
name: Release Devnet Chainspec
on:
workflow_dispatch:
push:
branches:
- devnet
paths:
- 'chainspecs/chain-spec.devnet.json'
jobs:
maybe_release:
permissions:
contents: write
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Check has changed
id: check_changed
run: |
git diff --quiet HEAD^ HEAD chainspecs/chain-spec.devnet.json || echo "changed=true" >> $GITHUB_OUTPUT
- name: Create timestamp (version)
if: steps.check_changed.outputs.changed == 'true'
id: timestamp
run: echo "timestamp=$(date +'%Y%m%d-%H%M')" >> $GITHUB_OUTPUT
- name: Create Release
if: steps.check_changed.outputs.changed == 'true'
uses: softprops/action-gh-release@v1
with:
tag_name: devnet-chainspec-v${{ steps.timestamp.outputs.timestamp }}
name: devnet-chainspec-${{ steps.timestamp.outputs.timestamp }}
body: |
Automated release of Devnet chainnspec.
draft: false
prerelease: false
files:
chainspecs/chain-spec.devnet.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}