Repository navigation
100 lines (81 loc) · 2.86 KB
/
Copy pathrelease.yml
File metadata and controls
100 lines (81 loc) · 2.86 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
name: Manual Build, Tag and Release
on:
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
container:
image: devkitpro/devkitarm:latest
steps:
- name: Checkout selected branch
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Install native build tools
run: |
apt-get update
apt-get install -y build-essential git zip
- name: Show selected branch
run: |
echo "Building ref: ${{ github.ref }}"
echo "Branch: ${{ github.ref_name }}"
- name: Read release version
id: version
shell: bash
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
major=$(sed -n 's/^LPVERSION_MAJOR := *\([0-9][0-9]*\).*$/\1/p' Versions.inc)
minor=$(sed -n 's/^LPVERSION_MINOR := *\([0-9][0-9]*\).*$/\1/p' Versions.inc)
patch=$(sed -n 's/^LPVERSION_BUGFX := *\([0-9][0-9]*\).*$/\1/p' Versions.inc)
version="v${major}.${minor}.${patch}"
test -n "$major" -a -n "$minor" -a -n "$patch"
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Build the project
run: make
- name: Create ZIP package
run: |
cd output
zip -r "../Lockpick_RCM-${{ steps.version.outputs.version }}.zip" .
cd ..
- name: Get latest commit message
id: changelog
shell: bash
run: |
message=$(git log -1 --pretty=%B)
{
echo "message<<EOF"
echo "$message"
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Tag and push
shell: bash
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
version="${{ steps.version.outputs.version }}"
echo "Creating tag $version from branch ${{ github.ref_name }}"
git tag "$version"
git push origin "$version"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.version }}
name: Release ${{ steps.version.outputs.version }}
body: |
Branch:
${{ github.ref_name }}
Changelog:
${{ steps.changelog.outputs.message }}
files: |
output/Lockpick_RCM.bin
Lockpick_RCM-${{ steps.version.outputs.version }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload compiled ZIP as artifact
uses: actions/upload-artifact@v4
with:
name: Lockpick_RCM-${{ steps.version.outputs.version }}-${{ github.ref_name }}
path: Lockpick_RCM-${{ steps.version.outputs.version }}.zip