Skip to content

Commit 68f7d01

Browse files
authored
Update create-release.yaml
1 parent a4c2edb commit 68f7d01

File tree

1 file changed

+19
-23
lines changed

1 file changed

+19
-23
lines changed
Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,29 @@
1-
name: Check for New Release
1+
name: Release Workflow
22

33
on:
4-
schedule:
5-
- cron: '0 */24 * * *' # Schedule to run every 6 hours
4+
repository_dispatch:
5+
types: [trigger-release]
66

77
jobs:
8-
check-for-release:
8+
create-release:
99
runs-on: ubuntu-latest
10+
1011
steps:
11-
- name: checkout
12+
- name: Checkout code
1213
uses: actions/checkout@v2
13-
with:
14-
fetch-depth: 0
15-
- name: check for new release
14+
15+
- name: Set up Git
1616
run: |
17-
upstreamTag=$(curl -s "https://api.github.com/repos/IntersectMBO/cardano-node/releases/latest" | jq -r '.tag_name')
18-
forkedTag=$(git describe --tags --abbrev=0)
17+
git config user.name "nanuijaz"
18+
git config user.email "nanuijaz@users.noreply.github.com"
1919
20-
echo "Upstream Tag: $upstreamTag"
21-
echo "Forked Tag: $forkedTag"
20+
- name: Get latest release version
21+
id: get-latest-release
22+
run: |
23+
latestTag=$(curl -s "https://api.github.com/repos/IntersecMBO/cardano-node/releases/latest" | jq -r '.tag_name')
24+
echo "::set-output name=tag::$latestTag"
2225
23-
if [ "$upstreamTag" != "$forkedTag" ]; then
24-
echo "New release detected. Triggering release workflow."
25-
curl -X POST \
26-
-H "Authorization: Bearer ${{ secrets.WORKFLOW_TOKEN }}" \
27-
-H "Accept: application/vnd.github.everest-preview+json" \
28-
-H "Content-Type: application/json" \
29-
https://api.github.com/repos/emurgo/cardano-node/dispatches \
30-
--data '{"event_type": "trigger-release"}'
31-
else
32-
echo "No new release detected."
33-
fi
26+
- name: Create release in forked repository
27+
run: |
28+
git tag -a "${{ steps.get-latest-release.outputs.tag }}" -m "Release notes for ${{ steps.get-latest-release.outputs.tag }}"
29+
git push origin "${{ steps.get-latest-release.outputs.tag }}"

0 commit comments

Comments
 (0)