-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manage auto-updates with renovate (#9)
- Loading branch information
Showing
6 changed files
with
41 additions
and
40 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": [ | ||
"config:recommended", | ||
":disableDependencyDashboard" | ||
], | ||
"automerge": true, | ||
"automergeStrategy": "squash", | ||
"enabledManagers": [ | ||
"dockerfile", | ||
"github-actions", | ||
"custom.regex" | ||
], | ||
"customManagers": [ | ||
{ | ||
"customType": "regex", | ||
"description": "Update sqlcmd version", | ||
"datasourceTemplate": "github-releases", | ||
"depNameTemplate": "microsoft/go-sqlcmd", | ||
"fileMatch": [ | ||
"^Dockerfile$", | ||
"^version$" | ||
], | ||
"matchStrings": [ | ||
"(?:ARG )?SQLCMD_VERSION=(?<currentValue>.+?)\\s" | ||
] | ||
} | ||
] | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,27 @@ | ||
# The workflow is used to check for new releases of the microsoft/go-sqlcmd tool. | ||
# If a new release is available, the workflow creates a new release in the current repository. | ||
|
||
# The workflow is used to publish new release on every "version" file change. | ||
name: Release | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0,12 * * *' | ||
push: | ||
branches: [main] | ||
paths: [version] | ||
|
||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/create-github-app-token@v1 | ||
id: app | ||
with: | ||
app-id: ${{ vars.GH_APP_ID }} | ||
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} | ||
|
||
- name: Check releases | ||
id: check | ||
env: | ||
GH_TOKEN: ${{ steps.app.outputs.token }} | ||
run: | | ||
latest() { gh release list -R ${1} --exclude-pre-releases --limit 1 --json tagName --jq '.[] | .tagName'; } | ||
echo image=$(latest "${{ github.repository }}") | tee -a $GITHUB_OUTPUT | ||
echo tool=$(latest "microsoft/go-sqlcmd") | tee -a $GITHUB_OUTPUT | ||
- name: Create release | ||
if: ${{ steps.check.outputs.tool != steps.check.outputs.image }} | ||
env: | ||
GH_TOKEN: ${{ steps.app.outputs.token }} | ||
run: | | ||
echo "Creating release for ${{ steps.check.outputs.tool }}" | ||
gh release create ${{ steps.check.outputs.tool }} \ | ||
--latest \ | ||
--title ${{ steps.check.outputs.tool }} \ | ||
--notes "Check https://github.com/microsoft/go-sqlcmd/releases/tag/${{ steps.check.outputs.tool }}" \ | ||
--repo ${{ github.repository }} | ||
set -u | ||
. version | ||
echo "Creating release for ${SQLCMD_VERSION}" | ||
gh release create ${SQLCMD_VERSION} --latest |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SQLCMD_VERSION=v1.6.0 |