diff --git a/.github/workflows/updatecli.yaml b/.github/workflows/updatecli.yaml new file mode 100644 index 00000000..3ba9201d --- /dev/null +++ b/.github/workflows/updatecli.yaml @@ -0,0 +1,29 @@ +name: updatecli +on: + # Allow to be run manually + workflow_dispatch: + schedule: + # Run once per week (to avoid alert fatigue) + - cron: '0 2 * * 1' # Every Monday at 2am UTC + push: + pull_request: +jobs: + updatecli: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Updatecli in the runner + uses: updatecli/updatecli-action@v2.21.0 + + - name: Run Updatecli in Dry Run mode + run: updatecli diff --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml + env: + UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Run Updatecli in Apply mode + if: github.ref == 'refs/heads/master' + run: updatecli apply --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml + env: + UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/updatecli/updatecli.d/git-windows.yml b/updatecli/updatecli.d/git-windows.yml new file mode 100644 index 00000000..88c99e44 --- /dev/null +++ b/updatecli/updatecli.d/git-windows.yml @@ -0,0 +1,151 @@ +--- +name: Bump Git version on Windows + +scms: + default: + kind: github + spec: + user: "{{ .github.user }}" + email: "{{ .github.email }}" + owner: "{{ .github.owner }}" + repository: "{{ .github.repository }}" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + branch: "{{ .github.branch }}" + +sources: + lastVersion: + kind: githubrelease + name: Get the latest Git version + spec: + owner: "git-for-windows" + repository: "git" + token: "{{ requiredEnv .github.token }}" + username: "{{ .github.username }}" + versionfilter: + kind: regex + ## Latest stable v{x.y.z}.windows. + pattern: 'v(\d*)\.(\d*)\.(\d*)\.windows\.(\d*)$' + transformers: + - trimprefix: "v" + +targets: + ############# JDK11 Nanoserver 18.09 + setGitVersionJDK11WindowsNanoserver1809: + name: Update the Git Windows version for JDK11 Windows Nanoserver 1809 + transformers: + - findsubmatch: + pattern: '(.*).windows\.(\d*)$' + captureindex: 1 + kind: dockerfile + spec: + file: 11/windows/nanoserver-ltsc2019/Dockerfile + instruction: + keyword: ARG + matcher: GIT_VERSION + scmid: default + setGitPackagePatchJDK11WindowsNanoserver1809: + name: Update the Git Package Windows patch for JDK11 Windows Nanoserver 1809 + transformers: + - findsubmatch: + pattern: '(.*).windows\.(\d*)$' + captureindex: 2 + kind: dockerfile + spec: + file: 11/windows/nanoserver-ltsc2019/Dockerfile + instruction: + keyword: ARG + matcher: GIT_PATCH_VERSION + scmid: default + ############# JDK11 Windows Server Core LTSC2019 + setGitVersionJDK11WindowsServer2019: + name: Update the Git Windows version for JDK11 Windows Server Core LTSC2019 + transformers: + - findsubmatch: + pattern: '(.*).windows\.(\d*)$' + captureindex: 1 + kind: dockerfile + spec: + file: 11/windows/windowsservercore-ltsc2019/Dockerfile + instruction: + keyword: ARG + matcher: GIT_VERSION + scmid: default + setGitPackagePatchJDK11WindowsServer2019: + name: Update the Git Package Windows patch for Windows Server Core LTSC2019 + transformers: + - findsubmatch: + pattern: '(.*).windows\.(\d*)$' + captureindex: 2 + kind: dockerfile + spec: + file: 11/windows/windowsservercore-ltsc2019/Dockerfile + instruction: + keyword: ARG + matcher: GIT_PATCH_VERSION + scmid: default + ############# JDK8 Nanoserver 18.09 + setGitVersionJDK8WindowsNanoserver1809: + name: Update the Git Windows version for JDK8 Windows Nanoserver 1809 + transformers: + - findsubmatch: + pattern: '(.*).windows\.(\d*)$' + captureindex: 1 + kind: dockerfile + spec: + file: 8/windows/nanoserver-ltsc2019/Dockerfile + instruction: + keyword: ARG + matcher: GIT_VERSION + scmid: default + setGitPackagePatchJDK8WindowsNanoserver1809: + name: Update the Git Package Windows patch for JDK8 Windows Nanoserver 1809 + transformers: + - findsubmatch: + pattern: '(.*).windows\.(\d*)$' + captureindex: 2 + kind: dockerfile + spec: + file: 8/windows/nanoserver-ltsc2019/Dockerfile + instruction: + keyword: ARG + matcher: GIT_PATCH_VERSION + scmid: default + ############# JDK8 Windows Server Core LTSC2019 + setGitVersionJDK8WindowsServer2019: + name: Update the Git Windows version for JDK8 Windows Server Core LTSC2019 + transformers: + - findsubmatch: + pattern: '(.*).windows\.(\d*)$' + captureindex: 1 + kind: dockerfile + spec: + file: 8/windows/windowsservercore-ltsc2019/Dockerfile + instruction: + keyword: ARG + matcher: GIT_VERSION + scmid: default + setGitPackagePatchJDK8WindowsServer2019: + name: Update the Git Package Windows patch for JDK8 Windows Server Core LTSC2019 + transformers: + - findsubmatch: + pattern: '(.*).windows\.(\d*)$' + captureindex: 2 + kind: dockerfile + spec: + file: 8/windows/windowsservercore-ltsc2019/Dockerfile + instruction: + keyword: ARG + matcher: GIT_PATCH_VERSION + scmid: default + +actions: + default: + kind: github/pullrequest + title: Bump Git version on Windows to {{ source "lastVersion" }} + scmid: default + spec: + labels: + - enhancement + - git + - windows diff --git a/updatecli/values.github-action.yaml b/updatecli/values.github-action.yaml new file mode 100644 index 00000000..6d94bf03 --- /dev/null +++ b/updatecli/values.github-action.yaml @@ -0,0 +1,8 @@ +github: + user: "GitHub Actions" + email: "41898282+github-actions[bot]@users.noreply.github.com" + username: "github-actions" + token: "UPDATECLI_GITHUB_TOKEN" + branch: "master" + owner: "jenkinsci" + repository: "docker-ssh-agent"