-
Notifications
You must be signed in to change notification settings - Fork 13
82 lines (71 loc) · 2.15 KB
/
release.yml
File metadata and controls
82 lines (71 loc) · 2.15 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
name: Release
on:
push:
branches: [main]
paths:
- VERSION
workflow_dispatch:
permissions:
contents: write
jobs:
release:
name: Build and Publish Release
runs-on: ubuntu-latest
steps:
- name: Check out sources
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
make 64tass \
python3 python3-pip
- name: Install git-cliff
run: pip install git-cliff
- name: Read the release version
id: read_version
run: |
VERSION="$(cat VERSION | tr -d '\r\n')"
if [ -z "$VERSION" ]; then
echo "VERSION file is empty."
exit 1
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version is $VERSION"
- name: Build the release
run: |
make -C source -B release V=1
- name: Create release archive
id: release_archive
run: |
VERSION="${{ steps.read_version.outputs.version }}"
PKG="superbasic-v${VERSION}"
mkdir -p dist/"$PKG"
cp -a .release/. dist/"$PKG"/
cd dist && zip -r "$PKG.zip" "$PKG"
echo "archive=dist/$PKG.zip" >> $GITHUB_OUTPUT
- name: Generate release notes
id: release_notes
run: |
{
echo 'release_notes<<EOF'
git cliff --config .github/cliff.toml \
--tag ${{ steps.read_version.outputs.version }} \
--unreleased
echo 'EOF'
} >> $GITHUB_OUTPUT
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.read_version.outputs.version }}
name: v${{ steps.read_version.outputs.version }}
target_commitish: ${{ github.sha }}
body: ${{ steps.release_notes.outputs.release_notes }}
draft: true
fail_on_unmatched_files: true
files: |
${{ steps.release_archive.outputs.archive }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}