-
Notifications
You must be signed in to change notification settings - Fork 5
79 lines (68 loc) · 2.41 KB
/
build.yml
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
name: build-runtime
on:
push:
branches: [ main ]
workflow_dispatch:
env:
# We cannot use env for containers...
# https://github.com/actions/runner/issues/2394
# CONTAINER: debian:bookworm
CONTAINER_NAME: Debian
CONTAINER_VERSION: 12
jobs:
build:
runs-on: ubuntu-latest
container:
image: debian:bookworm
# image: ${{ env.CONTAINER }}
steps:
- name: Install container dependencies
run: apt-get update -qq && apt -y install git sudo
- uses: actions/checkout@v4
with:
fetch-depth: 0
path: runtime_source
- name: Fetching Build Tools
uses: actions/checkout@v4
with:
repository: bottlesdevs/build-tools
path: build-tools
- name: Get release version
working-directory: runtime_source
id: vars
run: |
version=$(cat VERSION)
is_new_version=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} VERSION)
if ! [ -z "$is_new_version" ]; then
is_new_version=true
else
is_new_version=false
fi
echo "release_version=${version}" >> $GITHUB_OUTPUT
echo "new_version=${is_new_version}" >> $GITHUB_OUTPUT
- name: Make build scripts executable
working-directory: build-tools/runtime
run: chmod +x *
- name: Launch environment.sh
working-directory: build-tools/runtime
run: ./environment.sh "${{ steps.vars.outputs.release_version }}" ${{ env.CONTAINER_NAME }} ${{ env.CONTAINER_VERSION }}
- name: Launch build.sh
working-directory: build-tools/runtime
run: ./build.sh
- name: Rename runtime archive
run: |
mv "runtime.tar.gz" "runtime-${{ steps.vars.outputs.release_version }}.tar.gz"
- uses: "marvinpinto/action-automatic-releases@latest"
if: steps.vars.outputs.new_version == 'true'
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
draft: false
prerelease: false
automatic_release_tag: "${{ steps.vars.outputs.release_version }}"
title: "${{ steps.vars.outputs.release_version }}"
files: "runtime-${{ steps.vars.outputs.release_version }}.tar.gz"
- name: Upload log.txt
uses: actions/upload-artifact@v2
with:
name: log.txt
path: build-tools/runtime/runtimezilla/log.txt