-
Notifications
You must be signed in to change notification settings - Fork 245
110 lines (94 loc) · 3.05 KB
/
release.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# This workflow takes care of creating release archives for the
# Flint distribution. It is run for all PR and branch pushes as usual,
# but also on tags whose name starts with `vX.Y` with X, Y numbers
# (the idea is to use v1.2.3 or v1.2.3-dev)
#
# For builds triggered by a tag, the tag is turned into a GitHub release and
# the produced archives are attached to that.
name: "Wrap releases"
on:
workflow_dispatch:
pull_request:
push:
tags: v[1-9]+.[0-9]+.*
branches:
- trunk
- main
- master
- flint-*
schedule:
# Every day at 3:33 AM UTC
- cron: '33 3 * * *'
concurrency:
# group by workflow and ref; the last slightly strange component ensures that for pull
# requests, we limit to 1 concurrent job, but for the trunk branch we don't
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/trunk' || github.run_number }}
# Cancel intermediate builds, but only if it is a pull request build.
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
make-archive:
runs-on: ubuntu-latest
outputs:
get-version: ${{ steps.get-version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: "Setup"
run: |
sudo apt install -y libgmp-dev
sudo apt install -y libmpfr-dev
sudo apt install -y autoconf
sudo apt install -y libtool-bin
gcc --version
gcov --version
make --version
autoconf --version
libtool --version
- name: "Configure"
run: |
./bootstrap.sh
./configure
- name: "Record FLINT version"
id: get-version
run: |
FLINT_VERSION=$(make get_version)
echo "steps.get-version.outputs.version = ${FLINT_VERSION}"
echo "version=${FLINT_VERSION}" >> $GITHUB_OUTPUT
- name: "Create source archive"
run: make dist
- name: "Upload source archive as artifact"
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: flint
path: flint-${{ steps.get-version.outputs.version }}.tar.gz
retention-days: 1
test-archive:
needs: make-archive
runs-on: ubuntu-latest
env:
FLINT_VERSION: ${{ needs.make-archive.outputs.get-version }}
steps:
- name: "Download archive from previous job"
uses: actions/download-artifact@v3
with:
name: flint
- name: "Setup"
run: |
sudo apt install -y libgmp-dev
sudo apt install -y libmpfr-dev
# now *remove* autotools to verify we can build with out it
sudo apt remove -y autoconf
sudo apt remove -y automake
sudo apt remove -y libtool-bin
- name: "Configure"
run: |
./bootstrap.sh
./configure
- name: "Make"
run: |
make -j2
- name: "Check"
run: |
make -j2 check
# TODO: if desired, we can then also upload it to a GitHub release, copy
# it via scp to a server, or something else