fix: gather version for windows installation from latest releases metadata #385
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update dependencies | |
| on: | |
| pull_request: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| workflow_dispatch: | |
| jobs: | |
| dependabot: | |
| name: "@dependabot" | |
| if: github.event.pull_request.user.login == 'dependabot[bot]' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Collect metadata | |
| id: metadata | |
| uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0 | |
| with: | |
| github-token: "${{ secrets.GITHUB_TOKEN }}" | |
| - name: Milestone | |
| if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' | |
| run: gh pr edit --milestone "Next Release" "$PR_URL" | |
| env: | |
| PR_URL: ${{github.event.pull_request.html_url}} | |
| GH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| - name: Approve | |
| if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' | |
| run: gh pr review --approve "$PR_URL" | |
| env: | |
| PR_URL: ${{github.event.pull_request.html_url}} | |
| GH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| - name: Automerge | |
| if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' | |
| run: gh pr merge --auto --squash "$PR_URL" | |
| env: | |
| PR_URL: ${{ github.event.pull_request.html_url }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| golang: | |
| name: Bump the Golang version | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'pull_request' | |
| permissions: | |
| contents: none # Permissions are set with an application token | |
| steps: | |
| - name: Gather credentials | |
| id: credentials | |
| uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 | |
| with: | |
| app-id: ${{ secrets.GH_APP_ID_RELEASER }} | |
| private-key: ${{ secrets.GH_APP_PRIVATE_KEY_RELEASER }} | |
| - name: Checkout the repo | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: true | |
| ref: main | |
| token: ${{ steps.credentials.outputs.token }} | |
| - name: Install Golang | |
| uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 | |
| with: | |
| go-version: "stable" | |
| - name: Get the latest version | |
| id: version | |
| run: | | |
| LATEST=$(curl -s "https://go.dev/VERSION?m=text" | grep go) | |
| echo "latest=$LATEST" >> $GITHUB_OUTPUT | |
| - name: Bump module versions | |
| run: | | |
| sed -i "s/^go .*/go ${VERSION#go}/" go.mod | |
| go mod tidy | |
| sed -i "s/cimg\/go:.*/cimg\/go:${VERSION#go}/" .circleci/config.yml | |
| sed -i "s/go-version: .*/go-version: \"${VERSION#go}\"/" .github/workflows/tests.yml | |
| env: | |
| VERSION: ${{ steps.version.outputs.latest }} | |
| - name: Open a change request | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
| git checkout -b chore-bump-golang | |
| if git diff --quiet; then | |
| echo "No changes to commit, exiting." | |
| exit 0 | |
| fi | |
| git commit --all -m "build(deps): bump golang to ${VERSION#go}" | |
| git push -u origin chore-bump-golang | |
| gh pr create --title "build(deps): bump golang to ${VERSION#go}" --body "Automatic update to the latest release of Go" --milestone "Next Release" --label "code health" --label "semver:patch" | |
| env: | |
| GITHUB_TOKEN: ${{ steps.credentials.outputs.token }} | |
| VERSION: ${{ steps.version.outputs.latest }} |