forked from IntersectMBO/cardano-node
-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (40 loc) · 1.57 KB
/
create-release.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
43
44
45
name: Release Workflow
on:
repository_dispatch:
types: [trigger-release]
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Git
run: |
git config user.name "nanuijaz"
git config user.email "[email protected]"
- name: Get latest release version
id: get-latest-release
run: |
latestTag=$(curl -s "https://api.github.com/repos/IntersectMBO/cardano-node/releases" |jq -r '.[0].tag_name')
echo "${latestTag}"
if [ -n "$latestTag" ]; then
echo "RELEASE_TAG=${latestTag}" >> $GITHUB_ENV
else
echo "Failed to retrieve the latest release tag. API response: $response"
fi
- name: Create release in forked repository
run: |
if [ -n "${RELEASE_TAG}" ]; then
git tag -a "${RELEASE_TAG}" -m "Release notes for ${RELEASE_TAG}"
git push origin "${RELEASE_TAG}"
curl -X POST \
-H "Authorization: Bearer ${{ secrets.WORKFLOW_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/Emurgo/cardano-node/releases" \
-d '{"tag_name": "'"${RELEASE_TAG}"'", "name": "'"${RELEASE_TAG}"'", "body": "Release notes for '"${RELEASE_TAG}"'"}'
else
echo "No release tag available. Skipping release creation."
fi
- name: Display latest release version
run: |
echo "Latest Release: $RELEASE_TAG"