-
Notifications
You must be signed in to change notification settings - Fork 68
131 lines (130 loc) · 4.59 KB
/
build-binaries.yml
File metadata and controls
131 lines (130 loc) · 4.59 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
131
on:
schedule:
- cron: '0 4 * * 1-5'
# | | | | + day of week (0 - 6 or SUN-SAT)
# | | | +-- month (1 - 12 or JAN-DEC)
# | | +---- day of the month (1 - 31)
# | +------ hour (0 - 23)
# +-------- minute (0 - 59)
push:
tags:
- 2*.*.*
workflow_dispatch:
name: Build binaries
env:
DEFAULT_TAG: 24.0.999
jobs:
build:
name: Build and deploy
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-14, ubuntu-22.04, ubuntu-22.04-arm, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Initialize TAG and git autocrlf
shell: bash
run: |
git config --global core.autocrlf input
if [[ ${GITHUB_REF##*/} = 2*.[0-9]*.[0-9]* ]]; then
echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
else
echo "TAG=$DEFAULT_TAG" >> $GITHUB_ENV
fi
- name: Force Alire use preinstalled MSYS2
shell: bash
if: ${{ runner.os == 'Windows' }}
run: |
mkdir -p ~/.config/alire
echo '[msys2]' >> ~/.config/alire/config.toml
echo 'install_dir = "C:\\msys64"' >> ~/.config/alire/config.toml
- name: Get als
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch edge branch (for scheduled build only)
shell: bash
if: github.event.schedule
run: git checkout edge
- name: Get GNAT toolchain with alire
shell: bash
run: |
# alire-project/setup-alire works for ARM64 Mac OS X now. Shall we use it?
if [[ ${{ matrix.os }} == ubuntu-22.04-arm ]] ; then
# Alire 2.1.0 was built for ubuntu 24.04, doesn't work on 22.04
ZIP=nightly/alr-nightly-bin-aarch64-linux.zip
elif [[ "$RUNNER_ARCH" == ARM64 ]] ; then
ZIP=v2.1.0/alr-2.1.0-bin-aarch64-${RUNNER_OS}.zip
else
ZIP=v2.1.0/alr-2.1.0-bin-x86_64-${RUNNER_OS}.zip
fi
curl -L -O https://github.com/alire-project/alire/releases/download/$ZIP
unzip $(basename $ZIP)
bin/alr index --reset-community
bin/alr toolchain --select gnat_native gprbuild
echo $PWD/bin >> $GITHUB_PATH
- name: Fetch dependency commits numbers
shell: bash
if: ${{ env.TAG != env.DEFAULT_TAG }}
run: |
# For tags `actions/checkout@v2` action fetches a tag's commit, but
# not the tag annotation itself. Let's refetch the tag from origin.
# This makes `git show --no-patch --format=%n $TAG` work again.
git tag --delete $TAG
git fetch --tags
git show --no-patch --format=%n $TAG > deps.txt
- name: Build
shell: bash
run: |
scripts/build_als.sh all "$TAG"
- name: Test
shell: bash
run: |
scripts/build_als.sh test_als "$TAG"
- name: Archive Test Report
uses: actions/upload-artifact@v4
with:
name: als-test-report-${{ matrix.os }}
path: |
out/new
xunit.xml
- name: Archive ALS binary
uses: actions/upload-artifact@v4
with:
name: als-${{ matrix.os }}
# We know that only one of the following entries will match on a given
# run, so we use globs here to try to avoid warnings on unmatched
# entries
path: |
integration/vscode/ada/arm*
integration/vscode/ada/x64*
- name: Upload release
shell: bash
if: ${{ env.TAG != env.DEFAULT_TAG }}
run: |
.github/workflows/release.sh "${{ secrets.GITHUB_TOKEN }}" $TAG ""
- name: Package
shell: bash
run: |
.github/workflows/pack-binaries.sh "$TAG"
- name: Archive VSIX binary
uses: actions/upload-artifact@v4
with:
name: vsix-${{ matrix.os }}
path: "*.vsix"
- name: Upload result to AWS
shell: bash
if: ${{ github.repository == 'AdaCore/ada_language_server' && startsWith(matrix.os, 'macos-') }}
env:
AWS_ACCESS_KEY_ID: ${{secrets.GHA_PUBLISH_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.GHA_PUBLISH_SECRET}}
AWS_DEFAULT_REGION: eu-west-1
run: |
for FILE in *.vsix ; do
aws s3 cp ${FILE} s3://als-publish-adacore-eu-west-1/vscode-extension/${TAG}/ --sse=AES256
done
aws s3 ls s3://als-publish-adacore-eu-west-1/vscode-extension/${TAG}/