-
-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (45 loc) · 1.33 KB
/
build.yml
File metadata and controls
53 lines (45 loc) · 1.33 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
name: Build OS
on:
push:
branches:
- main
tags:
- "*"
pull_request:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: true # if you use submodules
- name: Build OS
run: |
make clean
./build.sh build
- name: Sanitize tag name
if: startsWith(github.ref, 'refs/tags/')
id: sanitize_tag
run: |
SAFE_TAG_NAME=$(echo "${GITHUB_REF_NAME}" | tr '/ ' '_')
echo "safe_tag_name=$SAFE_TAG_NAME" >> $GITHUB_ENV
env:
GITHUB_REF_NAME: ${{ github.ref_name }}
- name: Rename OS binary to include sanitized tag
if: startsWith(github.ref, 'refs/tags/')
run: |
sudo mv ./bin/os.bin ./bin/os-${safe_tag_name}.bin
sudo chown $USER:$USER ./bin/os-${safe_tag_name}.bin
- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ github.ref_name }}
name: Build OS ${{ github.ref_name }}
files: ./bin/os-${{ env.safe_tag_name }}.bin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
safe_tag_name: ${{ env.safe_tag_name }}