diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d946ffd --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,93 @@ +name: CI + +permissions: + contents: write + +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + name: "Build" + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-24.04] + include: + - os: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + - name: Build sourcemod plugin + uses: maxime1907/action-sourceknight@v1 + with: + cmd: build + + - name: Create package + run: | + mkdir -p /tmp/package + cp -R .sourceknight/package/* /tmp/package + + - name: Upload build archive for test runners + uses: actions/upload-artifact@v7 + with: + name: ${{ runner.os }} + path: /tmp/package + + tag: + name: Tag + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' + + - uses: dev-drprasad/delete-tag-and-release@v1.1 + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' + with: + delete_release: true + tag_name: latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - uses: rickstaa/action-create-tag@v1 + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' + with: + tag: "latest" + github_token: ${{ secrets.GITHUB_TOKEN }} + + release: + name: Release + if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' + needs: [build, tag] + runs-on: ubuntu-latest + steps: + - name: Download artifacts + uses: actions/download-artifact@v8 + with: + name: ${{ runner.os }} + path: artifacts + + - name: Versioning + run: | + version="latest" + if [[ "${{ github.ref_type }}" == 'tag' ]]; then + version=`echo $GITHUB_REF | sed "s/refs\/tags\///"`; + fi + echo "RELEASE_VERSION=$version" >> $GITHUB_ENV + + - name: Package + run: | + cd artifacts + ls -Rall + tar -czf ../${{ github.event.repository.name }}-${{ env.RELEASE_VERSION }}.tar.gz . + cd .. + ls -la *.tar.gz + + - name: Release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: '*.tar.gz' + tag: ${{ env.RELEASE_VERSION }} + file_glob: true + overwrite: true \ No newline at end of file diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml new file mode 100644 index 0000000..120c689 --- /dev/null +++ b/.github/workflows/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" \ No newline at end of file diff --git a/sourceknight.yaml b/sourceknight.yaml new file mode 100644 index 0000000..c36ef24 --- /dev/null +++ b/sourceknight.yaml @@ -0,0 +1,25 @@ +project: + sourceknight: 0.3 + name: QuickSwitch + + dependencies: + - name: sourcemod + type: tar + version: 1.12 + location: https://sm.alliedmods.net/smdrop/1.12/sourcemod-1.12.0-git7223-linux.tar.gz + unpack: + - source: /addons + dest: /addons + + - name: zombiereloaded + type: git + repo: https://github.com/srcdslab/sm-plugin-zombiereloaded + unpack: + - source: /src/addons/sourcemod/scripting/include + dest: /addons/sourcemod/scripting/include + + root: / + output: /addons/sourcemod/plugins + + targets: + - QuickSwitch \ No newline at end of file