# This defines the name of the workflow as it will appear in the "Actions" tab of the Gitea repository. name: Production deployment on: push: tags: - 'v*' env: HOMEBREW_REPO: "https://gitea.skydust.fr/Skydust/homebrew-clearscript.git" jobs: build-docker: name: Building and pushing runs-on: skydust-runner timeout-minutes: 30 steps: - name: Check out repo's default branch uses: actions/checkout@v4 - name: Getting version uses: https://gitea.skydust.fr/actions/get-version@main - name: Update package version run: | log_info "Updating version in version.sh to $(yellow)$NEW_VERSION" sed -Ei "s|^(Version=\")[^\"]*|\1${NEW_VERSION}|" Clear.sh mkdir dist/ && cp -v Clear.sh README.md dist/ - name: Publishing app version uses: https://gitea.skydust.fr/actions/publish-skydust-app@main with: appName: "brew-clearscript" publishFolder: "./dist" - name: Update homebrew repo run: | log_info "Shallow cloning the brew repo $(yellow)${HOMEBREW_REPO}" git clone --depth 1 "${HOMEBREW_REPO}" ./brew_repo/ cd brew_repo/ log_info "Modifying brew version" sed -Ei "s|(url \")[^\"]*|\1${PKG_URL}|" Formula/clearscript.rb sed -Ei "s|(sha256 \")[^\"]*|\1${PKG_SHA}|" Formula/clearscript.rb cat Formula/clearscript.rb echo git config user.email "release@example.com" git config user.name "Release" log_info "Overriding git repository auth with PAT" repo_url="$(git remote get-url origin)" repo_url="${repo_url#https://}" # Remove HTTPS GIT_NEW_URL="https://MilaBot:${{ secrets.CI_TOKEN }}@${repo_url}" git remote set-url origin "$GIT_NEW_URL" log_info "Pushing the new version" git add Formula git commit -m "Updated version to v${NEW_VERSION}" git push