From b3a2511aa9d75687f63ab96fdd03095a2bfa421c Mon Sep 17 00:00:00 2001 From: Laz Date: Fri, 8 Nov 2024 12:13:24 +0000 Subject: [PATCH] cicd: wip test cicd using wine-msvc --- .github/actions/msvc-wine/action.yml | 42 ++++++++++++++++++++++++++++ .github/workflows/nightly.yml | 39 ++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 .github/actions/msvc-wine/action.yml create mode 100644 .github/workflows/nightly.yml diff --git a/.github/actions/msvc-wine/action.yml b/.github/actions/msvc-wine/action.yml new file mode 100644 index 0000000..c108b0f --- /dev/null +++ b/.github/actions/msvc-wine/action.yml @@ -0,0 +1,42 @@ +name: "Download msvc-wine and cache it" +author: laz +description: "Download msvc-wine and cache it, or restore it from the cache" +runs: + using: composite + steps: + - name: "Install package dependencies" + run: | + sudo dpkg --add-architecture i386 && sudo apt-get update + sudo apt-get install wine64 wine32 python3 msitools ca-certificates cmake ninja-build winbind meson + wine64 wineboot + curl -s -L -O https://github.com/madewokherd/wine-mono/releases/download/wine-mono-5.1.1/wine-mono-5.1.1-x86.msi + wine64 msiexec /i wine-mono-5.1.1-x86.msi + + shell: bash + + - name: "Restore msvc-wine cache" + id: dependency-msvc-wine + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/msvc + key: dependency-msvc-wine + + - name: "Clone msvc-wine" + if: steps.dependency-msvc-wine.outputs.cache-hit != 'true' + uses: actions/checkout@v4 + with: + repository: 'mstorsjo/msvc-wine' + path: 'msvc-wine' + + - name: "Run msvc-wine setup" + if: steps.dependency-msvc-wine.outputs.cache-hit != 'true' + run: | + ${{ github.workspace }}/msvc-wine/vsdownload.py --accept-license --dest ${{ github.workspace }}/msvc + ${{ github.workspace }}/msvc-wine/install.sh ${{ github.workspace }}/msvc + shell: bash + + - name: "Setup x86 MSVC environment" + run: + source ${{ github.workspace }}/msvc/bin/x86/msvcenv.sh + echo $INCLUDE + shell: bash \ No newline at end of file diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000..1b4a543 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,39 @@ +name: Nightly Release +on: + # This can be used to automatically publish nightlies at UTC nighttime + schedule: + - cron: '0 3 * * *' # run at 3 AM UTC + # This can be used to allow manually triggering nightlies from the web interface + workflow_dispatch: + +jobs: + date-check: + runs-on: ubuntu-latest + name: Check latest commit + outputs: + should_run: ${{ steps.should_run.outputs.should_run }} + steps: + - uses: actions/checkout@v4 + - name: print latest_commit + run: echo ${{ github.sha }} + + - id: should_run + continue-on-error: true + name: check latest commit is less than a day + if: ${{ github.event_name == 'schedule' }} + run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false" + + build: + needs: date-check + if: ${{ needs.date-check.outputs.should_run != 'false' }} + runs-on: ubuntu-latest + steps: + # Clone this repo + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: 'recursive' + # Download and setup msvc-wine + - name: "Setup msvc-wine" + id: "msvc" + uses: "./.github/actions/msvc-wine" \ No newline at end of file