Nightly version ngdevkit-toolchain 0.1+202312101104-1 #106
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: BuildPackage | |
on: | |
push: | |
branches-ignore: | |
- 'main' | |
jobs: | |
pkgbuild: | |
name: "MSYS2 package" | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Install MSYS2 | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: UCRT64 | |
update: true | |
install: | |
git mingw-w64-ucrt-x86_64-toolchain | |
mingw-w64-ucrt-x86_64-jq | |
- name: Add ngdevkit repos | |
run: | | |
echo -e "[ngdevkit]\nSigLevel = Optional TrustAll\nServer = https://dciabrin.net/msys2-ngdevkit/\$arch" >> /etc/pacman.conf | |
pacman -Sy | |
- name: Build package | |
run: ./.ci/ci-build.sh | |
- name: Retrieve information from current commit | |
id: pkg_data | |
run: | | |
PKG=$(.ci/pkg-name-from-branch.sh) | |
source mingw-w64-$PKG/PKGBUILD | |
rel_pkg=${PKG} | |
rel_tag=${PKG}-${pkgver}-${pkgrel} | |
rel_date=$(echo ${pkgvernightly#*-} | sed 's/\(....\)\(..\)\(..\)\(..\)\(..\)/\1-\2-\3 \4:\5/') | |
rel_body=$(git show --quiet --format='%s') | |
rel_path=$(ls -1 mingw-w64-$PKG/*pkg.tar.zst) | |
rel_name=$(ls -1 mingw-w64-$PKG/*pkg.tar.zst | sed -e 's|.*/||') | |
echo "pkg=${rel_pkg}" >> "$GITHUB_OUTPUT" | |
echo "tag=${rel_tag}" >> "$GITHUB_OUTPUT" | |
echo "date=${rel_date}" >> "$GITHUB_OUTPUT" | |
echo "body=${rel_body}" >> "$GITHUB_OUTPUT" | |
echo "path=${rel_path}" >> "$GITHUB_OUTPUT" | |
echo "name=${rel_name}" >> "$GITHUB_OUTPUT" | |
- name: Check for release for nightly package | |
uses: mukunku/tag-exists-action@v1.2.0 | |
id: check_release | |
with: | |
tag: ${{ steps.pkg_data.outputs.tag }} | |
# TODO: use an action with built-in idempotency | |
- if: ${{ steps.check_release.outputs.exists == 'false' }} | |
name: Create a release for nightly package | |
id: pkg_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.pkg_data.outputs.tag }} | |
release_name: ${{ steps.pkg_data.outputs.pkg }} nightly build - ${{ steps.pkg_data.outputs.date }} | |
body: ${{ steps.pkg_data.outputs.body }} | |
draft: false | |
prerelease: true | |
# TODO: use an action with built-in idempotency | |
- if: ${{ steps.check_release.outputs.exists == 'false' }} | |
name: Upload nightly package | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.pkg_release.outputs.upload_url }} | |
asset_path: ${{ steps.pkg_data.outputs.path }} | |
asset_name: ${{ steps.pkg_data.outputs.name }} | |
asset_content_type: application/zstd | |
- name: Publish new package version | |
run: | | |
git config --global user.name 'CI build bot' | |
git config --global user.email '<>' | |
./.ci/publish-new-package-version.sh | |
- name: Clean up old releases and binaries | |
run: | | |
PKG=$(.ci/pkg-name-from-branch.sh) | |
.ci/gc-nightly-releases.sh --user dciabrin --package $PKG | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |