-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (59 loc) · 2.23 KB
/
dev_release.yml
File metadata and controls
67 lines (59 loc) · 2.23 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# https://github.com/marketplace/actions/automatic-releases
name: Nightly Dev Release
permissions:
contents: write
pull-requests: write
on:
schedule:
# every day at 1:44 am
- cron: '44 1 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
dev-release:
runs-on: ubuntu-latest
env:
DEVMD_SINCE: "2024-08-09" # optional fixed start date
TAG_NAME: "dev" # reuse the same tag each night
RELEASE_TITLE: "Dev Nightly"
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Generate dev notes
run: |
ci/update-devmd.sh
# (Optional) Only extract the auto section between markers for the release body
- name: Extract release body from dev.md markers
id: notes
run: |
awk '/<!-- AUTO-DEVMD:START -->/{f=1;print;next} /<!-- AUTO-DEVMD:END -->/{print;f=0} f' releases/dev.md > /tmp/release_notes.md
# Fallback to entire file if markers missing or empty
if [ ! -s /tmp/release_notes.md ]; then
cp releases/dev.md /tmp/release_notes.md
fi
- name: Create or move tag to current commit
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag -f "${TAG_NAME}" "${GITHUB_SHA}"
git push --force origin "refs/tags/${TAG_NAME}"
- name: Delete existing release (if any)
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release view "${TAG_NAME}" >/dev/null 2>&1 && \
gh release delete "${TAG_NAME}" -y || \
echo "No existing release to delete"
- name: Create/Update release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.TAG_NAME }}
name: ${{ env.RELEASE_TITLE }}
# If the tag didn’t exist the very first time, this tells the action
# what commit to use to create it (safe to keep even after creation):
commit: ${{ github.sha }}
bodyFile: /tmp/release_notes.md
prerelease: true
allowUpdates: true
artifactErrorsFailBuild: false