From 82dfb1a05ab69a166fa12e598117fa8e60ba228c Mon Sep 17 00:00:00 2001 From: maxime1907 <19607336+maxime1907@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:54:55 +0200 Subject: [PATCH] fix(ci): update ci --- .github/dependabot.yml | 9 +++++ .github/workflows/ci.yml | 82 ++++++++++++++++++++-------------------- 2 files changed, 51 insertions(+), 40 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..c6947d261 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + labels: + - "dependencies" + - "bot" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80586eef5..a16387e0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,16 @@ -name: CI - -on: [push, pull_request, workflow_dispatch] +name: Build and release + +on: + push: + branches: + - main + - master + tags: + - 'v*.*.*' + pull_request: + branches: + - main + - master jobs: build: @@ -9,17 +19,21 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, windows-2019, macos-10.15] + os: [ubuntu-20.04, windows-2019, macos-11] sourcemod-version: [1.11-dev] + python-version: ['3.10'] include: - os: ubuntu-20.04 target-archs: x86,x86_64 + platform: linux - os: windows-2019 target-archs: x86,x86_64 + platform: windows - - os: macos-10.15 + - os: macos-11 target-archs: x86_64 + platform: macos steps: - name: Install Linux packages @@ -28,33 +42,29 @@ jobs: sudo apt update sudo apt install -yq --no-install-recommends g++-multilib - - name: Set up Python - uses: actions/setup-python@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: extension - name: Checkout SourceMod - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: alliedmodders/sourcemod ref: ${{ matrix.sourcemod-version }} path: sourcemod submodules: recursive - - name: Checkout AMBuild - uses: actions/checkout@v2 - with: - repository: alliedmodders/ambuild - path: ambuild - - name: Install AMBuild - uses: BSFishy/pip-action@v1 - with: - packages: ./ambuild - + run: | + python -m pip install wheel + pip install git+https://github.com/alliedmodders/ambuild + - name: Build working-directory: extension shell: bash @@ -67,12 +77,11 @@ jobs: ambuild - name: Upload artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: - name: ${{ runner.os }} + name: ${{ github.event.repository.name }}-${{ matrix.platform }}-${{ matrix.sourcemod-version }} path: extension/build/package - release: name: Release if: startsWith(github.ref, 'refs/tags/') @@ -81,31 +90,24 @@ jobs: steps: - name: Download artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 - name: Package run: | - version=`echo $GITHUB_REF | sed "s/refs\/tags\///"` - if [ -d "./Linux/" ]; then - cd ./Linux/ - tar -czf ../${{ github.event.repository.name }}-${version}-linux.tar.gz -T <(\ls -1) - cd - - fi - if [ -d "./macOS/" ]; then - cd ./macOS/ - tar -czf ../${{ github.event.repository.name }}-${version}-mac.tar.gz -T <(\ls -1) - cd - - fi - if [ -d "./Windows/" ]; then - cd ./Windows/ - tar -czf ../${{ github.event.repository.name }}-${version}-windows.tar.gz -T <(\ls -1) - cd - - fi + for folder in ./*; do + if [ -d "$folder" ]; then + echo "Processing folder: $folder" + cd $folder + tar -czf ../$folder.tar.gz -T <(\ls -1) + cd .. + sha256sum $folder.tar.gz > $folder.tar.gz.sha256 + fi + done - name: Release uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: '*.tar.gz' + file: '*.tar.gz*' tag: ${{ github.ref }} file_glob: true