diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100755 index 00000000..dc9fd054 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,89 @@ +name: Continuous Integration + +on: + push: + pull_request: + +permissions: + contents: read # to fetch code (actions/checkout) + +jobs: + linux: + name: Linux (.NET 6.0) + runs-on: ubuntu-22.04 + + steps: + - name: Clone Repository + uses: actions/checkout@v3 + + - name: Install .NET 6.0 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '6.0.x' + + - name: Prepare Environment + run: | + . mod.config; + awk '/\r$$/ { exit(1); }' mod.config || (printf "Invalid mod.config format. File must be saved using unix-style (LF, not CRLF or CR) line endings.\n"; exit 1); + + - name: Check Code + run: | + make + make check-packaging-scripts + + - name: Check Mod + run: | + sudo apt-get install lua5.1 + make check-scripts + make test + + linux-mono: + name: Linux (mono) + runs-on: ubuntu-22.04 + + steps: + - name: Clone Repository + uses: actions/checkout@v3 + + - name: Prepare Environment + run: | + . mod.config; + awk '/\r$$/ { exit(1); }' mod.config || (printf "Invalid mod.config format. File must be saved using unix-style (LF, not CRLF or CR) line endings.\n"; exit 1); + + - name: Check Code + run: | + # check-packaging-scripts does not depend on .net/mono, so is not needed here + mono --version + make RUNTIME=mono + + - name: Check Mod + run: | + # check-scripts does not depend on .net/mono, so is not needed here + make RUNTIME=mono test + + windows: + name: Windows (.NET 6.0) + runs-on: windows-2019 + + steps: + - name: Clone Repository + uses: actions/checkout@v3 + + - name: Install .NET 6.0 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '6.0.x' + + - name: Check Code + shell: powershell + run: | + # Work around runtime failures on the GH Actions runner + dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org + .\make.ps1 check + + - name: Check Mods + run: | + choco install lua --version 5.1.5.52 + $ENV:Path = $ENV:Path + ";C:\Program Files (x86)\Lua\5.1\" + .\make.ps1 check-scripts + .\make.ps1 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index bec88f6a..00000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,24 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Deploy - -on: - release: - types: [released] - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - deploy: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - steps: - - name: Deploy to server - uses: appleboy/ssh-action@master - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - password: ${{ secrets.PASSWORD }} - port: ${{ secrets.PORT }} - script: ./deploy-ca-server.sh diff --git a/.github/workflows/release.yml b/.github/workflows/packaging.yml old mode 100644 new mode 100755 similarity index 78% rename from .github/workflows/release.yml rename to .github/workflows/packaging.yml index 77ae30de..7a32f93b --- a/.github/workflows/release.yml +++ b/.github/workflows/packaging.yml @@ -1,22 +1,23 @@ -name: Release +name: Release Packaging on: push: - # Sequence of patterns matched against refs/tags tags: - - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 + - '*' + +permissions: + contents: write # for release creation (svenstaro/upload-release-action) jobs: linux: name: Linux AppImages - runs-on: ubuntu-20.04 - + runs-on: ubuntu-22.04 steps: - name: Clone Repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Install .NET 6 - uses: actions/setup-dotnet@v1 + - name: Install .NET 6.0 + uses: actions/setup-dotnet@v3 with: dotnet-version: '6.0.x' @@ -27,35 +28,34 @@ jobs: run: | make engine mkdir -p build/linux + sudo apt install libfuse2 ./packaging/linux/buildpackage.sh "${GIT_TAG}" "${PWD}/build/linux" - + - name: Upload Packages uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ github.ref }} - prerelease: true overwrite: true file_glob: true file: build/linux/* macos: - name: macOS Disk Images + name: macOS Disk Image runs-on: macos-11 - steps: - name: Clone Repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Install .NET 6 - uses: actions/setup-dotnet@v1 + - name: Install .NET 6.0 + uses: actions/setup-dotnet@v3 with: dotnet-version: '6.0.x' - name: Prepare Environment run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> ${GITHUB_ENV} - - name: Package Disk Images + - name: Package Disk Image env: MACOS_DEVELOPER_IDENTITY: ${{ secrets.MACOS_DEVELOPER_IDENTITY }} MACOS_DEVELOPER_CERTIFICATE_BASE64: ${{ secrets.MACOS_DEVELOPER_CERTIFICATE_BASE64 }} @@ -66,26 +66,25 @@ jobs: make engine mkdir -p build/macos ./packaging/macos/buildpackage.sh "${GIT_TAG}" "${PWD}/build/macos" - - name: Upload Packages + + - name: Upload Package uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ github.ref }} - prerelease: true overwrite: true file_glob: true file: build/macos/* windows: name: Windows Installers - runs-on: ubuntu-20.04 - + runs-on: ubuntu-22.04 steps: - name: Clone Repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Install .NET 6 - uses: actions/setup-dotnet@v1 + - name: Install .NET 6.0 + uses: actions/setup-dotnet@v3 with: dotnet-version: '6.0.x' @@ -94,17 +93,18 @@ jobs: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> ${GITHUB_ENV} sudo apt-get update sudo apt-get install nsis wine64 + - name: Package Installers run: | make engine mkdir -p build/windows ./packaging/windows/buildpackage.sh "${GIT_TAG}" "${PWD}/build/windows" + - name: Upload Packages uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ github.ref }} - prerelease: true overwrite: true file_glob: true file: build/windows/* diff --git a/packaging/linux/buildpackage.sh b/packaging/linux/buildpackage.sh old mode 100644 new mode 100755 diff --git a/packaging/macos/buildpackage.sh b/packaging/macos/buildpackage.sh old mode 100644 new mode 100755 diff --git a/packaging/windows/buildpackage.sh b/packaging/windows/buildpackage.sh old mode 100644 new mode 100755