CI: Update to latest github action version #1404
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: CI | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '30 19 * * *' | |
jobs: | |
build-package: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- MINGW_ARCH: "mingw32" | |
- MINGW_ARCH: "mingw64" | |
- MINGW_ARCH: "ucrt64" | |
runs-on: windows-latest | |
env: | |
MINGW_ARCH: ${{ matrix.MINGW_ARCH }} | |
APPVEYOR_SCHEDULED_BUILD: ${{ github.event.schedule }} | |
DEPLOY_REPO_NAME: oneclick/rubyinstaller2-packages | |
DEPLOY_TAG: ci.ri2 | |
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} | |
steps: | |
- name: configure git crlf | |
run: | | |
git config --system core.autocrlf false | |
git config --system core.eol lf | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: '0' | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "3.0" | |
- run: bundle install | |
- name: Update MSYS2 | |
shell: powershell | |
# See https://github.com/msys2/MSYS2-packages/issues/258 | |
run: | | |
C:\msys64\usr\bin\rm -rf $env:MINGW_PREFIX/bin/libcrypto-3-x64.dll $env:MINGW_PREFIX/bin/libssl-3-x64.dll $env:MINGW_PREFIX/etc/ssl/openssl.cnf | |
C:\msys64\usr\bin\pacman --noconfirm --ask 20 --sync --refresh --refresh --sysupgrade --sysupgrade | |
Get-Process | Where-Object {$_.path -like 'C:\msys64*'} | Stop-Process | |
C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh --sysupgrade --sysupgrade | |
- name: Print version info | |
shell: cmd | |
run: | | |
ruby -v | |
ridk exec gcc -v | |
- name: Build packages | |
shell: cmd | |
env: | |
GPGPASSWD: ${{ secrets.GPGPASSWD }} | |
run: C:\msys64\usr\bin\bash --login -c "$(cygpath ${GITHUB_WORKSPACE})/ci-build.sh" | |
- name: Create lock ID | |
shell: cmd | |
run: ruby -e 'puts "DEPLOY_LOCK=#{rand}"' >>%GITHUB_ENV% | |
- name: Lock package repository | |
shell: cmd | |
run: rake upload:lock | |
- name: Download package database | |
shell: cmd | |
env: | |
GPGPASSWD: ${{ secrets.GPGPASSWD }} | |
run: | | |
ridk exec bash -c "source 'ci-library.sh'; deploy_enabled && cd artifacts && create_pacman_repository 'ci.ri2'" | |
- name: Backup pacman database as artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pacman-database | |
path: | | |
artifacts/*.db.tar.zst | |
artifacts/*.db.tar.zst.sig | |
artifacts/*.db | |
artifacts/*.db.sig | |
artifacts/*.files.tar.zst | |
artifacts/*.files.tar.zst.sig | |
artifacts/*.files | |
artifacts/*.files.sig | |
- name: Upload packages | |
shell: cmd | |
run: rake upload -- artifacts/*.pkg.tar.zst artifacts/*.pkg.tar.zst.sig artifacts/*.db.tar.zst artifacts/*.db.tar.zst.sig artifacts/*.db artifacts/*.db.sig artifacts/*.files.tar.zst artifacts/*.files.tar.zst.sig artifacts/*.files artifacts/*.files.sig | |
- name: Remove outdated packages from github releases | |
shell: cmd | |
run: rake upload:remove_old | |
- name: Unlock package repository | |
shell: cmd | |
if: ${{ always() }} | |
run: rake upload:unlock |