Merge remote branch 'origin/master' into edge #1329
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- edge | |
tags: | |
- 2*.*.* | |
name: Build binaries | |
env: | |
DEFAULT_TAG: 23.0.999 | |
AWS_DEFAULT_REGION: eu-west-1 | |
jobs: | |
build: | |
name: Build and deploy | |
strategy: | |
fail-fast: false | |
matrix: # Build debug and/or production | |
debug: [''] # '' if production, 'debug' for debug | |
os: [macos-11, ubuntu-20.04, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Setup Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
- 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: Install iconv and gmp (Windows only) | |
if: ${{ runner.os == 'Windows' }} | |
uses: msys2/setup-msys2@v2 | |
with: | |
path-type: inherit | |
update: true | |
install: >- | |
mingw64/mingw-w64-x86_64-libiconv | |
mingw64/mingw-w64-x86_64-gmp | |
- name: Get als | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get VSS | |
uses: actions/checkout@v3 | |
with: | |
repository: AdaCore/VSS | |
path: subprojects/VSS | |
- name: Get Spawn | |
uses: actions/checkout@v3 | |
with: | |
repository: AdaCore/spawn | |
path: subprojects/spawn | |
- name: Get LAL_Tools | |
uses: actions/checkout@v3 | |
with: | |
repository: AdaCore/libadalang-tools | |
path: subprojects/libadalang-tools | |
- name: Get Templates Parser | |
uses: actions/checkout@v3 | |
with: | |
repository: AdaCore/templates-parser | |
path: subprojects/templates-parser | |
- name: Get GNATdoc | |
uses: actions/checkout@v3 | |
with: | |
repository: AdaCore/gnatdoc | |
path: subprojects/gnatdoc | |
ref: edge | |
- name: Get LAL Refactor | |
uses: actions/checkout@v3 | |
with: | |
repository: AdaCore/lal-refactor | |
path: subprojects/lal-refactor | |
ref: edge | |
- uses: actions/cache@v3 | |
with: | |
path: ./cached_gnat | |
key: ${{ runner.os }}-alire-2022 | |
restore-keys: ${{ runner.os }}-alire-2022 | |
- name: Get GNAT toolchain with alire | |
uses: alire-project/setup-alire@v2 | |
with: | |
toolchain: gnat_native^12 gprbuild^22 | |
toolchain_dir: ./cached_gnat | |
- name: Build (Windows) | |
if: ${{ runner.os == 'Windows' }} | |
shell: msys2 {0} | |
env: | |
AWS_ACCESS_KEY_ID: ${{secrets.GHA_CACHE_ACCESS_KEY_ID}} | |
AWS_SECRET_ACCESS_KEY: ${{secrets.GHA_CACHE_SECRET}} | |
run: | | |
# This is to avoid locking .sh on win that prevents its updating | |
cp .github/workflows/build-binaries.sh .github/workflows/build-binaries.sh_ | |
.github/workflows/build-binaries.sh_ "${{ matrix.debug }}" ${{ runner.os }} ${{ env.TAG }} | |
- name: Build (non-Windows) | |
env: | |
AWS_ACCESS_KEY_ID: ${{secrets.GHA_CACHE_ACCESS_KEY_ID}} | |
AWS_SECRET_ACCESS_KEY: ${{secrets.GHA_CACHE_SECRET}} | |
if: ${{ runner.os != 'Windows' }} | |
run: .github/workflows/build-binaries.sh "${{ matrix.debug }}" ${{ runner.os }} ${{ env.TAG }} | |
- name: Archive ALS binary | |
if: ${{ github.event_name == 'push' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: als-${{ runner.os }}-${{ matrix.debug }} | |
# 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* | |
package: | |
if: ${{ github.event_name == 'push' }} | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get als | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v3 | |
- name: Pack vscode extension | |
run: | | |
if [[ ${GITHUB_REF##*/} = 2*.[0-9]*.[0-9]* ]]; then | |
TAG="${GITHUB_REF##*/}" | |
.github/workflows/release.sh "" "${{ secrets.GITHUB_TOKEN }}" $TAG | |
# .github/workflows/release.sh "debug" "${{ secrets.GITHUB_TOKEN }}" $TAG | |
else | |
TAG="$DEFAULT_TAG" | |
fi | |
echo "TAG=$TAG" >> $GITHUB_ENV | |
.github/workflows/pack-binaries.sh "" "${{secrets.VSCE_TOKEN}}" "${{secrets.OPENVSX_TOKEN}}" $TAG | |
# .github/workflows/pack-binaries.sh "debug" "${{secrets.VSCE_TOKEN}}" "${{secrets.OPENVSX_TOKEN}}" $TAG | |
- name: Archive ALS vsix | |
uses: actions/upload-artifact@v3 | |
with: | |
name: als-vsix-${{ matrix.debug }}${{ env.TAG }} | |
path: '*.vsix' |