forked from westes/flex
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (82 loc) · 2.97 KB
/
nightly.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
80
81
82
83
84
85
name: Nightly
on:
schedule:
- cron: '04 00 * * *'
workflow_dispatch:
permissions: {}
jobs:
nightly:
name: Run a Nightly Build and Save the Artifacts
runs-on: ubuntu-20.04
outputs:
version: ${{ steps.version.outputs.version }}
permissions:
actions: read
contents: read
steps:
- uses: actions/checkout@v4
- name: Change version number
id: version
run: |
slug=$(git log -n 1 --pretty='format:%h-%as')
authorDate=$(echo $slug | cut -d '-' -f 2-4)
[ $(( $(date +%s) - $(date --date=$authorDate +%s) )) -ge 172,800 ] && echo "::notice title=No Changes::No changes within the last two days. Skipping nightly build." && exit 1
ver=$(sed -n "s/^\(AC_INIT.*generator\],\)\[\(.*\)\]\(,\[flex-help.*\)$/\2/p" $GITHUB_WORKSPACE/configure.ac)
ver=${ver#v}
ver=${ver%-*}
ver=$ver-$slug
echo "version=$ver" >> $GITHUB_OUTPUT
sed -i "s/^\(AC_INIT.*generator\],\)\(.*\)\(,\[flex-help.*\)$/\1[$ver]\3/" $GITHUB_WORKSPACE/configure.ac
- name: apt
run: sudo apt-get update && sudo apt-get install -y gcc autoconf automake libtool flex bison gettext autopoint help2man lzip texinfo texlive
- name: Update CHANGE_LOG
run: |
./tools/git2cl > $GITHUB_WORKSPACE/ChangeLog
- name: build
run: |
./autogen.sh
./configure
make
make distcheck
- name: Make Git archives
env:
ver: ${{ steps.version.outputs.version }}
run: |
git archive -o $ver.src.tar.gz --prefix=flex-$ver/ HEAD
TZ=America/Los_Angeles git archive -o $ver.src.zip --prefix=flex-$ver/ HEAD
echo "SOURCE_GZ=$(echo $ver.src.tar.gz)" >> $GITHUB_ENV
echo "SOURCE_ZIP=$(echo $ver.src.zip)" >> $GITHUB_ENV
- name: Get artifact names
env:
ver: ${{ steps.version.outputs.version }}
run: |
echo "ARTIFACT_GZ=$(echo flex-$ver.tar.gz)" >> $GITHUB_ENV
echo "ARTIFACT_LZ=$(echo flex-$ver.tar.lz)" >> $GITHUB_ENV
- name: Upload Nightly tar.gz
id: upload-nightly-asset-gz
uses: actions/upload-artifact@v4
with:
path: ${{ env.ARTIFACT_GZ }}
name: ${{ env.ARTIFACT_GZ }}
overwrite: true
- name: Upload Nightly tar.lz
id: upload-nightly-asset-lz
uses: actions/upload-artifact@v4
with:
path: ${{ env.ARTIFACT_LZ }}
name: ${{ env.ARTIFACT_LZ }}
overwrite: true
- name: Upload Nightly src.tar.gz
id: upload-nightly-src-gz
uses: actions/upload-artifact@v4
with:
path: ${{ env.SOURCE_GZ }}
name: ${{ env.SOURCE_GZ }}
overwrite: true
- name: Upload Nightly src.tar.zip
id: upload-nightly-src-zip
uses: actions/upload-artifact@v4
with:
path: ${{ env.SOURCE_ZIP }}
name: ${{ env.SOURCE_ZIP }}
overwrite: true