-
Notifications
You must be signed in to change notification settings - Fork 114
42 lines (40 loc) Β· 1.68 KB
/
release-pr.yaml
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
name: Release PR
on:
pull_request:
branches:
- master
env:
V4_API_KEY_MAINNET: ${{ secrets.V4_API_KEY_MAINNET }}
V4_API_KEY_TESTNET: ${{ secrets.V4_API_KEY_TESTNET }}
V3_API_KEY_MAINNET: ${{ secrets.V3_API_KEY_MAINNET }}
V3_API_KEY_TESTNET: ${{ secrets.V3_API_KEY_TESTNET }}
NON_TATUM_RPC_ETH_URL: ${{ secrets.NON_TATUM_RPC_ETH_URL }}
VERBOSE: ${{ secrets.verbose }}
jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Checkout current
uses: actions/checkout@v3
- name: Get state current
run: |
hash=$(sha1sum CHANGELOG.md | cut -f1 -d' ')
version=$(jq -r '.version' package.json)
echo "pr_pkg_version=$version" >> $GITHUB_ENV
echo "pr_changelog_hash=$hash" >> $GITHUB_ENV
- name: Check if release exists
run: |
curl --fail --silent --max-time 5 "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${{ env.pr_pkg_version }}" && echo "release_exists=true" >> $GITHUB_ENV || echo "release_exists=false" >> $GITHUB_ENV
- name: Checkout master
uses: actions/checkout@v3
with:
ref: master
- name: Get state master
run: |
hash=$(sha1sum CHANGELOG.md | cut -f1 -d' ')
version=$(jq -r '.version' package.json)
echo "master_pkg_version=$version" >> $GITHUB_ENV
echo "master_changelog_hash=$hash" >> $GITHUB_ENV
- name: Ensure changelog updated if version changed
run: |
[ "${{ env.release_exists }}" == "false" ] && [ "${{ env.pr_changelog_hash }}" = "${{ env.master_changelog_hash }}" ] && echo "Error: no changes in changelog detected for the release" && exit 1 || exit 0