From 1b7afa5c6a3bc64d771c306703b61a3229002c53 Mon Sep 17 00:00:00 2001 From: Wunkolo Date: Mon, 8 May 2023 08:44:21 -0700 Subject: [PATCH] Add github-actions continuous integration --- .github/workflows/ci.yml | 73 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e95bccd --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,73 @@ +name: Build + +on: + push: + paths-ignore: + - "**.md" + branches: + - main + - dev + pull_request: + paths-ignore: + - "**.md" + branches: + - main + release: + +jobs: + windows-build: + runs-on: windows-latest + strategy: + matrix: + arch: [x86, x64, x64_arm64] + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: "recursive" + + - name: Configure msvc + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{matrix.arch}} + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" + + - name: Build + run: cmake --build ${{github.workspace}}/build --config Release --target SaiThumbs --parallel 8 + + - name: Zipping artifacts + run: > + 7z a SaiThumbs-${{matrix.arch}}.zip + ${{github.workspace}}/build/bin/install.bat + ${{github.workspace}}/build/bin/uninstall.bat + ${{github.workspace}}/build/bin/SaiThumbs.dll + + - uses: actions/upload-artifact@v3 + if: github.ref == 'refs/heads/main' + with: + name: SaiThumbs-${{matrix.arch}} + path: | + SaiThumbs-${{matrix.arch}}.zip + + create-release: + if: github.ref == 'refs/heads/main' + needs: windows-build + runs-on: ubuntu-latest + steps: + - name: Download Artifacts + id: download + uses: actions/download-artifact@v3 + with: + path: artifacts + + - name: Create release + uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "latest" + prerelease: false + title: "Latest Build" + files: ${{steps.download.outputs.download-path}}/*