From 8e0db94517e0ba1fb3d0fc3a276e2e7f12a9c170 Mon Sep 17 00:00:00 2001 From: Augusto Silva Date: Tue, 21 Jul 2026 10:53:59 +0200 Subject: [PATCH] refactor(ci): update workflows for fork --- .github/workflows/ci.yml | 3 + .github/workflows/deploy-docs.yml | 8 +-- .github/workflows/release-next.yml | 26 +++---- .github/workflows/release.yml | 105 +++++++++++++++-------------- 4 files changed, 73 insertions(+), 69 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e59f5c4..6e6acd55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,9 @@ on: name: CI +permissions: + contents: read + jobs: check: name: Check and Clippy diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index ebcf3256..e437903d 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -1,10 +1,10 @@ name: Deploy Docs to GitHub Pages on: - push: - branches: [main] - paths: - - 'docs/**' + # push: + # branches: [main] + # paths: + # - 'docs/**' workflow_dispatch: # Allow this job to clone the repo and create a page deployment diff --git a/.github/workflows/release-next.yml b/.github/workflows/release-next.yml index 57a71866..1ac7e949 100644 --- a/.github/workflows/release-next.yml +++ b/.github/workflows/release-next.yml @@ -7,9 +7,9 @@ on: description: "Branch to release from" required: false default: "next" - push: - branches: - - next + # push: + # branches: + # - next concurrency: group: release-next @@ -64,16 +64,16 @@ jobs: strategy: matrix: include: - - build: linux - os: depot-ubuntu-22.04-8 - target: x86_64-unknown-linux-gnu - - build: aarch64 - os: depot-ubuntu-22.04-arm-8 - target: aarch64-unknown-linux-gnu - linker: gcc-aarch64-linux-gnu - - build: macos - os: depot-macos-14 - target: x86_64-apple-darwin + # - build: linux + # os: depot-ubuntu-22.04-8 + # target: x86_64-unknown-linux-gnu + # - build: aarch64 + # os: depot-ubuntu-22.04-arm-8 + # target: aarch64-unknown-linux-gnu + # linker: gcc-aarch64-linux-gnu + # - build: macos + # os: depot-macos-14 + # target: x86_64-apple-darwin - build: macos-aarch64 os: depot-macos-14 target: aarch64-apple-darwin diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 770e8b1e..5226102b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,11 +1,12 @@ name: Create Release on: - push: - branches: - - main - paths: - - "Cargo.toml" + # push: + # branches: + # - main + # paths: + # - "Cargo.toml" + workflow_dispatch: jobs: check_version: @@ -168,50 +169,50 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - update_homebrew_formula: - needs: [build, check_version] - runs-on: ubuntu-latest - if: ${{ needs.check_version.outputs.version_changed == 'true' }} - steps: - - name: Checkout Homebrew Tap Repository - run: git clone https://github.com/mentimeter/homebrew-mentimeter.git - - - name: Update Homebrew Formula - run: | - RELEASE_VERSION="${{ needs.build.outputs.release_version }}" - FORMULA_PATH="homebrew-mentimeter/linkup.rb" - - if [ -z "$RELEASE_VERSION" ]; then - printf '%s\n' 'RELEASE_VERSION variable is empty' - exit 1 - fi - - MAC_ARM_SHA=$(echo "${{ needs.build.outputs.mac_arm_sha }}" | awk '{print $1}') - MAC_X86_SHA=$(echo "${{ needs.build.outputs.mac_x86_sha }}" | awk '{print $1}') - LINUX_ARM_SHA=$(echo "${{ needs.build.outputs.linux_arm_sha }}" | awk '{print $1}') - LINUX_X86_SHA=$(echo "${{ needs.build.outputs.linux_x86_sha }}" | awk '{print $1}') - - # Update the SHA values - sed -i "s|MAC_ARM_SHA = \".*\"|MAC_ARM_SHA = \"$MAC_ARM_SHA\"|" "$FORMULA_PATH" - sed -i "s|MAC_X86_SHA = \".*\"|MAC_X86_SHA = \"$MAC_X86_SHA\"|" "$FORMULA_PATH" - sed -i "s|LINUX_ARM_SHA = \".*\"|LINUX_ARM_SHA = \"$LINUX_ARM_SHA\"|" "$FORMULA_PATH" - sed -i "s|LINUX_X86_SHA = \".*\"|LINUX_X86_SHA = \"$LINUX_X86_SHA\"|" "$FORMULA_PATH" - - # Update the URLs with the new release version - sed -i "s|https://github.com/mentimeter/linkup/releases/download/[^/]*/linkup-[^/]*aarch64-apple-darwin.tar.gz|https://github.com/mentimeter/linkup/releases/download/$RELEASE_VERSION/linkup-aarch64-apple-darwin.tar.gz|" "$FORMULA_PATH" - sed -i "s|https://github.com/mentimeter/linkup/releases/download/[^/]*/linkup-[^/]*x86_64-apple-darwin.tar.gz|https://github.com/mentimeter/linkup/releases/download/$RELEASE_VERSION/linkup-x86_64-apple-darwin.tar.gz|" "$FORMULA_PATH" - sed -i "s|https://github.com/mentimeter/linkup/releases/download/[^/]*/linkup-[^/]*aarch64-unknown-linux-gnu.tar.gz|https://github.com/mentimeter/linkup/releases/download/$RELEASE_VERSION/linkup-aarch64-unknown-linux-gnu.tar.gz|" "$FORMULA_PATH" - sed -i "s|https://github.com/mentimeter/linkup/releases/download/[^/]*/linkup-[^/]*x86_64-unknown-linux-gnu.tar.gz|https://github.com/mentimeter/linkup/releases/download/$RELEASE_VERSION/linkup-x86_64-unknown-linux-gnu.tar.gz|" "$FORMULA_PATH" - - cd homebrew-mentimeter - - git remote set-url origin https://x-access-token:${COMMIT_TOKEN}@github.com/mentimeter/homebrew-mentimeter.git - git config --global user.name "mentibot" - git config --global user.email "122382604+mentibot@users.noreply.github.com" - - git add linkup.rb - git commit -m "Update Linkup formula to $RELEASE_VERSION" - - git push origin HEAD:main - env: - COMMIT_TOKEN: ${{ secrets.COMMIT_TOKEN }} + # update_homebrew_formula: + # needs: [build, check_version] + # runs-on: ubuntu-latest + # if: ${{ needs.check_version.outputs.version_changed == 'true' }} + # steps: + # - name: Checkout Homebrew Tap Repository + # run: git clone https://github.com/mentimeter/homebrew-mentimeter.git + + # - name: Update Homebrew Formula + # run: | + # RELEASE_VERSION="${{ needs.build.outputs.release_version }}" + # FORMULA_PATH="homebrew-mentimeter/linkup.rb" + + # if [ -z "$RELEASE_VERSION" ]; then + # printf '%s\n' 'RELEASE_VERSION variable is empty' + # exit 1 + # fi + + # MAC_ARM_SHA=$(echo "${{ needs.build.outputs.mac_arm_sha }}" | awk '{print $1}') + # MAC_X86_SHA=$(echo "${{ needs.build.outputs.mac_x86_sha }}" | awk '{print $1}') + # LINUX_ARM_SHA=$(echo "${{ needs.build.outputs.linux_arm_sha }}" | awk '{print $1}') + # LINUX_X86_SHA=$(echo "${{ needs.build.outputs.linux_x86_sha }}" | awk '{print $1}') + + # # Update the SHA values + # sed -i "s|MAC_ARM_SHA = \".*\"|MAC_ARM_SHA = \"$MAC_ARM_SHA\"|" "$FORMULA_PATH" + # sed -i "s|MAC_X86_SHA = \".*\"|MAC_X86_SHA = \"$MAC_X86_SHA\"|" "$FORMULA_PATH" + # sed -i "s|LINUX_ARM_SHA = \".*\"|LINUX_ARM_SHA = \"$LINUX_ARM_SHA\"|" "$FORMULA_PATH" + # sed -i "s|LINUX_X86_SHA = \".*\"|LINUX_X86_SHA = \"$LINUX_X86_SHA\"|" "$FORMULA_PATH" + + # # Update the URLs with the new release version + # sed -i "s|https://github.com/mentimeter/linkup/releases/download/[^/]*/linkup-[^/]*aarch64-apple-darwin.tar.gz|https://github.com/mentimeter/linkup/releases/download/$RELEASE_VERSION/linkup-aarch64-apple-darwin.tar.gz|" "$FORMULA_PATH" + # sed -i "s|https://github.com/mentimeter/linkup/releases/download/[^/]*/linkup-[^/]*x86_64-apple-darwin.tar.gz|https://github.com/mentimeter/linkup/releases/download/$RELEASE_VERSION/linkup-x86_64-apple-darwin.tar.gz|" "$FORMULA_PATH" + # sed -i "s|https://github.com/mentimeter/linkup/releases/download/[^/]*/linkup-[^/]*aarch64-unknown-linux-gnu.tar.gz|https://github.com/mentimeter/linkup/releases/download/$RELEASE_VERSION/linkup-aarch64-unknown-linux-gnu.tar.gz|" "$FORMULA_PATH" + # sed -i "s|https://github.com/mentimeter/linkup/releases/download/[^/]*/linkup-[^/]*x86_64-unknown-linux-gnu.tar.gz|https://github.com/mentimeter/linkup/releases/download/$RELEASE_VERSION/linkup-x86_64-unknown-linux-gnu.tar.gz|" "$FORMULA_PATH" + + # cd homebrew-mentimeter + + # git remote set-url origin https://x-access-token:${COMMIT_TOKEN}@github.com/mentimeter/homebrew-mentimeter.git + # git config --global user.name "mentibot" + # git config --global user.email "122382604+mentibot@users.noreply.github.com" + + # git add linkup.rb + # git commit -m "Update Linkup formula to $RELEASE_VERSION" + + # git push origin HEAD:main + # env: + # COMMIT_TOKEN: ${{ secrets.COMMIT_TOKEN }}