avoid to use ! in bash. #173
Workflow file for this run
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: 'build' | |
on: | |
push: | |
branches: | |
- '*' | |
tags: | |
- '*' | |
concurrency: nope | |
jobs: | |
build-installer: | |
runs-on: windows-2022 | |
strategy: | |
fail-fast: false | |
matrix: | |
scalaVersion: [2.11, 2.12, 2.13] | |
spinalVersion: [1.11.0] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: setup-msys2 | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: MINGW64 | |
update: true | |
install: >- | |
tar | |
zip | |
unzip | |
git | |
mingw-w64-x86_64-qt-installer-framework | |
mingw-w64-x86_64-7zip | |
- name: Switch to the main mirror | |
shell: msys2 {0} | |
run: | | |
echo 'Server = https://repo.msys2.org/mingw/$repo/' > /etc/pacman.d/mirrorlist.mingw | |
echo 'Server = https://repo.msys2.org/msys/$arch/' > /etc/pacman.d/mirrorlist.msys | |
pacman-conf.exe | |
- name: Update using the main mirror & Check install | |
run: | | |
msys2 -c 'pacman --noconfirm -Suuy' | |
msys2 -c 'pacman --noconfirm -Suu' | |
msys2 -c 'pacman -Qkq' | |
- name: Build Installer | |
shell: msys2 {0} | |
run: | | |
bash make-msys2-installer ${{ matrix.scalaVersion }} ${{ matrix.spinalVersion }} | |
- name: Upload Results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: installer-${{ matrix.scalaVersion }}-${{ matrix.spinalVersion }} | |
path: msys2-* | |
test-installer: | |
runs-on: windows-${{ matrix.image }} | |
needs: build-installer | |
strategy: | |
fail-fast: false | |
matrix: | |
image: [2019, 2022] | |
scalaVersion: [2.11, 2.12, 2.13] | |
spinalVersion: [1.11.0] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: installer-${{ matrix.scalaVersion }}-${{ matrix.spinalVersion }} | |
- name: Install | |
run: | | |
./msys2-x86_64-${{ matrix.scalaVersion }}-${{ matrix.spinalVersion }}.exe in --confirm-command --accept-messages --root C:/msys2-install-test | |
- name: Test without Login Shell | |
run: | | |
C:\msys2-install-test\usr\bin\pacman.exe -Syy | |
C:\msys2-install-test\usr\bin\pacman.exe --noconfirm -S vim | |
- name: Test pacman | |
run: | | |
C:\msys2-install-test\usr\bin\bash.exe -lc "pacman --version" | |
C:\msys2-install-test\usr\bin\bash.exe -lc "pacman -Qkv" | |
C:\msys2-install-test\usr\bin\bash.exe -lc "pacman -Syy" | |
C:\msys2-install-test\usr\bin\bash.exe -lc "pacman --noconfirm -S git" | |
- name: Test | |
shell: cmd | |
run: | | |
set MSYS2_PATH_TYPE=inherit | |
set MSYSTEM=MINGW64 | |
set CHERE_INVOKING=yes | |
C:\msys2-install-test\usr\bin\bash.exe -lc "sh test_template.sh ${{ matrix.scalaVersion }} ${{ matrix.spinalVersion }}" | |
- name: Uninstall | |
run: | | |
C:\msys2-install-test\uninstall.exe pr --confirm-command | |
upload-nightly: | |
permissions: | |
contents: write | |
needs: | |
- test-installer | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Create 'latest' Variants and Checksums | |
run: | | |
cd artifacts | |
find . -type f -exec sha256sum {} \; > msys2-checksums.txt | |
- name: Set Release Tag | |
id: set_tag | |
if: startsWith(github.ref, 'refs/heads/') | |
run: echo "tag_name=all-in-one-$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT | |
- name: Upload Installers | |
uses: ncipollo/release-action@v1 | |
if: startsWith(github.ref, 'refs/heads/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag: ${{ steps.set_tag.outputs.tag_name }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
draft: true | |
generateReleaseNotes: true | |
artifacts: | | |
artifacts/**/* | |
artifacts/msys2-checksums.txt | |
- name: Upload Installers with Tag | |
uses: ncipollo/release-action@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
generateReleaseNotes: true | |
draft: false | |
prerelease: false | |
artifacts: | | |
artifacts/**/* | |
artifacts/msys2-checksums.txt |