WIP: Remove everything from build.yml except for the first step #1273
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
name: Builds | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
schedule: | |
- cron: '0 0 * * *' | |
permissions: | |
contents: read | |
jobs: | |
# For scheduled builds, get the commit ids of the latest versions to build. | |
# | |
# Doing this as one single job, which then propagates the information further | |
# to the other jobs, so that all build jobs in one workflow builds the exact | |
# same version. This allows trusting builds without assertions enabled | |
# slightly more, when we know a separate build of the same version but with | |
# assertions enabled, has passed some amount of tests. | |
prepare: | |
if: (github.event_name != 'schedule') || (github.repository == 'mstorsjo/llvm-mingw') | |
runs-on: ubuntu-latest | |
outputs: | |
LLVM_VERSION: ${{steps.get-versions.outputs.LLVM_VERSION}} | |
MINGW_W64_VERSION: ${{steps.get-versions.outputs.MINGW_W64_VERSION}} | |
PYTHON_VERSION_MINGW: ${{steps.get-versions.outputs.PYTHON_VERSION_MINGW}} | |
TAG: ${{steps.get-tag.outputs.TAG}} | |
COMMIT_DATE_UNIX: ${{steps.get-tag.outputs.COMMIT_DATE_UNIX}} | |
BUILD_DATE: ${{steps.get-tag.outputs.BUILD_DATE}} | |
BUILD_DATE_UNIX: ${{steps.get-tag.outputs.BUILD_DATE_UNIX}} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
sparse-checkout: . | |
- name: Select build tag | |
id: get-tag | |
run: | | |
if ${{github.event_name == 'schedule'}}; then | |
TAG=nightly | |
else | |
TAG=$(TZ=UTC date +%Y%m%d) | |
fi | |
echo TAG=$TAG >> $GITHUB_OUTPUT | |
echo COMMIT_DATE_UNIX=$(git log -1 --pretty=%ct $GITHUB_SHA) >> $GITHUB_OUTPUT | |
BUILD_DATE=$(date -u '+%FT%TZ') | |
echo BUILD_DATE=${BUILD_DATE} >> $GITHUB_OUTPUT | |
echo BUILD_DATE_UNIX=$(date -d "${BUILD_DATE}" +%s) >> $GITHUB_OUTPUT | |
cat $GITHUB_OUTPUT | |
cat $GITHUB_OUTPUT >> parameters.txt | |
- name: Check latest version | |
if: github.event_name == 'schedule' | |
id: get-versions | |
run: | | |
echo LLVM_VERSION=$(git ls-remote https://github.com/llvm/llvm-project.git | grep 'refs/heads/main$' | awk '{print $1}') >> $GITHUB_OUTPUT | |
echo MINGW_W64_VERSION=$(git ls-remote https://github.com/mingw-w64/mingw-w64.git | grep 'refs/heads/master$' | awk '{print $1}') >> $GITHUB_OUTPUT | |
echo PYTHON_VERSION_MINGW=$(git ls-remote https://github.com/msys2-contrib/cpython-mingw.git | grep 'refs/heads/mingw-v3.11.6$' | awk '{print $1}') >> $GITHUB_OUTPUT | |
cat $GITHUB_OUTPUT | |
cat $GITHUB_OUTPUT >> parameters.txt | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: parameters | |
path: | | |
parameters.txt | |
retention-days: 7 |