summaryrefslogtreecommitdiffstats
path: root/.github/workflows/sync-module-tags.yaml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/sync-module-tags.yaml')
-rw-r--r--.github/workflows/sync-module-tags.yaml35
1 files changed, 35 insertions, 0 deletions
diff --git a/.github/workflows/sync-module-tags.yaml b/.github/workflows/sync-module-tags.yaml
new file mode 100644
index 0000000..bb28453
--- /dev/null
+++ b/.github/workflows/sync-module-tags.yaml
@@ -0,0 +1,35 @@
+on:
+ push:
+ tags: ['v*']
+
+permissions:
+ contents: write
+
+# When a repository has multiple Go modules, in order to version the non-root
+# modules, the repo must have a tag named like '<module>/<version>'. This
+# workflow responds to pushes of tags named like "vXXX" by also tagging
+# <module>/<version> accordingly, for all sub-Go-modules.
+#
+# For example, when tagging v2.3.4, this workflow will tag the same commit with
+# pkg/signature/kms/aws/v2.3.4, so that the kms/aws module is also tagged
+# v2.3.4.
+
+jobs:
+ sync-tags:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ module:
+ - pkg/signature/kms/aws
+ - pkg/signature/kms/azure
+ - pkg/signature/kms/gcp
+ - pkg/signature/kms/hashivault
+ steps:
+ - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+ - run: |
+ tag="${{ matrix.module }}/${{ github.ref_name }}"
+ echo tagging "${tag}"
+ git config user.name "${GITHUB_ACTOR}"
+ git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
+ git tag -a "${tag}" -m "syncing module ${{ matrix.module }} @ ${{ github.ref_name }}"
+ git push origin "${tag}"