-
Notifications
You must be signed in to change notification settings - Fork 5
77 lines (68 loc) · 2.17 KB
/
prepare-release.yml
File metadata and controls
77 lines (68 loc) · 2.17 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
---
# Copyright © 2022-2025 Matt Robinson
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: Prepare Release
on:
workflow_dispatch:
inputs:
version:
description: Version
required: true
permissions:
contents: write
jobs:
prepare:
name: Prepare Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Draft release notes
run: |
lasttag=$(git describe --abbrev=0 HEAD)
pattern='^Bump ([^ ]+)( from [0-9.-]+ to ([0-9.-]+))?$'
while read -r message; do
if [[ $message =~ $pattern ]]; then
ver=${BASH_REMATCH[3]}
case "${BASH_REMATCH[1]}" in
com.nerdoftheherd:android-dropbear)
echo "* Updated bundled Dropbear binaries to $ver."
;;
com.nerdoftheherd:android-rsync)
echo "* Updated bundled rsync binary to $ver."
;;
*)
updated_deps=1
;;
esac
else
echo "* $message."
fi
done <<< "$(git log --format='%s' "$lasttag..HEAD")" > relnotes
if [ "$updated_deps" ]; then
echo "* Updated dependencies." >> relnotes
fi
- name: Tag release
run: |
git config user.name github-actions[bot]
git config user.email \
41898282+github-actions[bot]@users.noreply.github.com
git tag -a -m "${{ inputs.version }} release" "${{ inputs.version }}"
git push --tags
- name: Create draft release
uses: actions/github-script@v9
with:
script: |
const fs = require('fs')
const relnotes = fs.readFileSync('relnotes', 'utf8')
await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: '${{ inputs.version }}',
name: 'Rsync for Tasker ${{ inputs.version }}',
body: relnotes,
draft: true
});