-
Notifications
You must be signed in to change notification settings - Fork 1
130 lines (111 loc) · 3.65 KB
/
linux.yml
File metadata and controls
130 lines (111 loc) · 3.65 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Linux
on:
workflow_dispatch:
workflow_call:
jobs:
check-for-changes:
runs-on: ubuntu-latest
outputs:
should_build: ${{ steps.check.outputs.should_build }}
steps:
- name: Checkout HEAD only
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Fetch 'nightly' tag only
run: git fetch origin refs/tags/nightly:refs/tags/nightly || true
- name: Check for changes since nightly
id: check
run: |
if git rev-parse nightly >/dev/null 2>&1; then
nightly_commit=$(git rev-list -n 1 nightly)
head_commit=$(git rev-parse HEAD)
echo "Nightly tag commit: $nightly_commit"
echo "HEAD commit: $head_commit"
if [ "$nightly_commit" = "$head_commit" ]; then
echo "should_build=false" >> $GITHUB_OUTPUT
else
echo "should_build=true" >> $GITHUB_OUTPUT
fi
else
echo "should_build=true" >> $GITHUB_OUTPUT
fi
build:
runs-on: ubuntu-latest
needs: check-for-changes
if: needs.check-for-changes.outputs.should_build == 'true'
steps:
- name: Install bootstrap compiler
run: |
sudo rm -rf /var/lib/apt/lists/*
sudo apt-get clean
sudo apt-get update -o Acquire::Retries=3
sudo apt-get install -y --no-install-recommends fpc-3.2.2
- name: Checkout source
uses: actions/checkout@v3
- name: Build FPC x86_64 (native)
run: |
make distclean
make all CPU_TARGET=x86_64
- name: Install FPC x86_64
run: make install CPU_TARGET=x86_64 INSTALL_PREFIX=$PWD/fpc
- name: Build i386 cross-compiler
run: make crossinstall OS_TARGET=linux CPU_TARGET=i386 INSTALL_PREFIX=$PWD/fpc PP=$PWD/compiler/ppcx64
- name: Package artifacts
run: |
mv compiler/ppcx64 fpc/bin
mv compiler/ppcross386 fpc/bin
mv fpc/lib/fpc/3.3.1/units fpc/units
rm -rf fpc/lib
rm -rf fpc/share
zip -rq linux-bundle.zip fpc
zip -j linux-ppcx64.zip fpc/bin/ppcx64
zip -j linux-ppcross386.zip fpc/bin/ppcross386
- name: Upload linux-bundle.zip
uses: actions/upload-artifact@v4
with:
name: linux-bundle.zip
path: linux-bundle.zip
- name: Upload linux-ppcx64.zip
uses: actions/upload-artifact@v4
with:
name: linux-ppcx64.zip
path: linux-ppcx64.zip
- name: Upload linux-ppcross386.zip
uses: actions/upload-artifact@v4
with:
name: linux-ppcross386.zip
path: linux-ppcross386.zip
- name: Prepare release
run: |
ts=$(TZ=Europe/Berlin date +"%Y-%m-%d %H:%M:%S CEST")
echo "TAG=nightly" >> $GITHUB_ENV
echo "NAME=FPC Unleashed nightly" >> $GITHUB_ENV
{
echo "FPC Unleashed nightly build"
echo
echo "Generated from commit: $GITHUB_SHA"
echo "Build time: $ts"
} > release-body.txt
- name: Update tag
uses: richardsimko/update-tag@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: linux-bundle.zip,linux-ppcx64.zip,linux-ppcross386.zip
tag: ${{ env.TAG }}
name: ${{ env.NAME }}
bodyFile: release-body.txt
prerelease: true
allowUpdates: true
skip:
runs-on: ubuntu-latest
needs: check-for-changes
if: needs.check-for-changes.outputs.should_build == 'false'
steps:
- name: Skip build
run: echo "No new commits since last release. Skipping."