Repository navigation
109 lines (97 loc) · 3.49 KB
/
Copy pathprerelease_github.yml
File metadata and controls
109 lines (97 loc) · 3.49 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: prerelease_github
on:
workflow_dispatch:
inputs:
draft:
description: 'Keep the pre-release as a draft, hidden until published by hand'
type: boolean
default: false
# To build every push to develop as well, uncomment:
# push:
# branches: [ develop ]
# paths-ignore:
# - "**.md"
# - "resources/translations/**"
# - ".github/ISSUE_TEMPLATE/**"
concurrency:
group: prerelease_github
cancel-in-progress: true
permissions:
contents: read
env:
# AppImage updates of a dev build follow this tag, see scripts/init_app_vars.sh
PRERELEASE_TAG: continuous
jobs:
test:
uses: ./.github/workflows/test.yml
build:
needs: [ test ]
uses: ./.github/workflows/build.yml
with:
dev: true
prerelease:
needs: [ build ]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Extract unreleased changes
uses: ffurrer2/extract-release-notes@v3
with:
prerelease: true
release_notes_file: unreleased.md
- name: Compose release notes
env:
REF_NAME: ${{ github.ref_name }}
COMMIT_SHA: ${{ github.sha }}
REPO_URL: ${{ github.server_url }}/${{ github.repository }}
BUILD_VERSION: ${{ needs.build.outputs.version }}
run: |
last_release=$(grep -m1 -oP '^## \[\K[0-9][^]]*' CHANGELOG.md || true)
since=${last_release:+ since $last_release}
{
echo "Built from \`$REF_NAME\` at [\`${COMMIT_SHA::7}\`]($REPO_URL/commit/$COMMIT_SHA) on $(date -u +%F). Reports version \`$BUILD_VERSION\`."
echo
echo "> **Development build, not a stable release.** For everyday use grab the [latest release]($REPO_URL/releases/latest)."
echo ">"
echo "> It may change your settings and playlists in ways the stable release cannot read back. To keep them apart, use the Windows portable zip, or start it with \`--user-data-dir <folder>\`."
echo
if grep -q '^- ' unreleased.md; then
echo "## Changes$since"
echo
cat unreleased.md
else
echo "No changes recorded in the changelog$since."
fi
if [ -n "$last_release" ]; then
echo
echo "The changelog is updated now and then, see [all commits since $last_release]($REPO_URL/compare/v$last_release...$COMMIT_SHA) for the rest."
fi
} > release_notes.md
- name: Load release binaries
uses: actions/download-artifact@v8
with:
pattern: release_dist_bin_*
merge-multiple: true
path: dist
- name: Move ${{ env.PRERELEASE_TAG }} tag to current commit
run: |
git tag -f "$PRERELEASE_TAG"
git push -f origin "refs/tags/$PRERELEASE_TAG"
- name: Update pre-release
uses: ncipollo/release-action@v1
with:
name: Development build (${{ needs.build.outputs.version }})
bodyFile: release_notes.md
artifacts: "dist/*"
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.PRERELEASE_TAG }}
commit: ${{ github.sha }}
# also applied on update, so a run without it publishes a draft left by an earlier one
draft: ${{ inputs.draft == true }}
prerelease: true
makeLatest: false
allowUpdates: true
removeArtifacts: true