-
Notifications
You must be signed in to change notification settings - Fork 27
50 lines (48 loc) · 1.65 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
46
47
48
49
50
name: Release Notes
on:
push:
tags:
- "*"
jobs:
notes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get Previous Tag
run: |
PREVIOUS_TAG=$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))
echo ${PREVIOUS_TAG}
echo "previous_tag=${PREVIOUS_TAG}" >> $GITHUB_ENV
- name: Get New Tag
run: |
NEW_TAG=${GITHUB_REF#refs/tags/}
echo ${NEW_TAG}
echo "new_tag=${NEW_TAG}" >> $GITHUB_ENV
- uses: actions/setup-node@v4
- name: Generate Release Notes
run: |
NOTES=$(npx generate-github-release-notes ilios frontend ${{ env.previous_tag }} ${{env.new_tag}})
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "${NOTES}"
echo "RELEASE_NOTES<<$EOF" >> "$GITHUB_ENV"
echo "${NOTES}" >> $GITHUB_ENV
echo "$EOF" >> "$GITHUB_ENV"
- name: Generate Release Name
run: |
NAME=$(npx dartajax-music random-song)
echo ${NAME}
echo "RELEASE_NAME=${NAME}" >> $GITHUB_ENV
- uses: ncipollo/release-action@v1
with:
name: ${{env.RELEASE_NAME}}
body: ${{env.RELEASE_NOTES}}
token: ${{ secrets.ZORGBORT_TOKEN }}
- uses: act10ns/slack@v2
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ILIOS_DEPLOYMENT_WEBHOOK_URL }}
with:
status: ${{ job.status }}
message: Release Failed {{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/actions/runs/{{ env.GITHUB_RUN_ID }}