]> git.ipfire.org Git - thirdparty/linux-firmware.git/commitdiff
Add a rule for automatic tagging releases by pipeline schedule
authorMario Limonciello <mario.limonciello@amd.com>
Thu, 31 Aug 2023 02:19:49 +0000 (21:19 -0500)
committerMario Limonciello <mario.limonciello@amd.com>
Thu, 31 Aug 2023 03:58:36 +0000 (22:58 -0500)
This requires a personal access token with write repository permissions
to be created and a pipeline scheduled with the RELEASE_TOKEN masked
variable set.

When that combination is done, a tag is automatically created following
`YYYYMMDD` syntax when the pipeline runs.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
.gitlab-ci.yml

index ae001d16b5dd983fd8ba9bf1281a12dbb6fe19f9..7e5abc58c26b9212321d7ab5d1ceed200bb1eac0 100644 (file)
@@ -1,11 +1,23 @@
-
 check-commits:
+  stage: test
   image: registry.gitlab.com/kernel-firmware/linux-firmware
   script:
     - ci-fairy check-commits --signed-off-by
 
 pre-commit:
+  stage: test
   image: registry.gitlab.com/kernel-firmware/linux-firmware
   script:
     - pre-commit run --all-files
 
+release:
+  stage: deploy
+  rules:
+    - if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
+      when: never
+    - if: $RELEASE_TOKEN
+  script:
+    - CI_PUSH_REPO=`echo "$CI_REPOSITORY_URL" | sed 's/^.*@/@/g'`
+    - git remote set-url --push origin "https://gitlab-ci-token:${RELEASE_TOKEN}$CI_PUSH_REPO"
+    - git tag `date "+%Y%m%d"`
+    - git push --tags