Skip to content

Commit

Permalink
Added all releases to gitlab pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Oct 28, 2024
1 parent bcc57de commit bdbf19e
Show file tree
Hide file tree
Showing 8 changed files with 305 additions and 5 deletions.
39 changes: 39 additions & 0 deletions k3s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
k3s-check:
image: registry.gitlab.com/uniget-org/images/ubuntu:rolling
script:
- |
VERSION="$(
curl --silent --show-error --location --fail \
--url "https://api.github.com/repos/k3s-io/k3s/releases/latest" \
| jq --raw-output '.tag_name' \
| sed -E 's/^v([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+)\+k3s([[:digit:]]+)$/\1.\2/'
)"
if test -z "${VERSION}"; then
echo "Failed to fetch latest tag and extract version from GitHub"
exit 1
fi
echo "Got version <${VERSION}>"
echo "version=${VERSION}" >>variables.env
artifacts:
reports:
dotenv: variables.env

k3s-release:
needs:
- k3s-check
image: registry.gitlab.com/gitlab-org/release-cli:v0.19.0
script:
- |
echo "### Releasing k3s v${VERSION}"
if release-cli get --tag-name k3s/${VERSION}; then
echo " Already exists"
exit 0
else
release-cli create \
--name "k3s v${VERSION}" \
--description "Custom release of k3s v${VERSION}" \
--tag-name "k3s/${VERSION}" \
--ref "${CI_COMMIT_SHA}"
fi
38 changes: 38 additions & 0 deletions namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
namespace-check:
image: registry.gitlab.com/uniget-org/images/ubuntu:rolling
script:
- |
VERSION="$(
curl --silent --show-error --location --fail https://github.com/namespacelabs/homebrew-namespace/raw/main/nsc.rb \
| grep version \
| cut -d'"' -f2
)"
if test -z "${VERSION}"; then
echo "Failed to fetch latest tag and extract version from GitHub"
exit 1
fi
echo "Got version <${VERSION}>"
echo "version=${VERSION}" >>variables.env
artifacts:
reports:
dotenv: variables.env

namespace-release:
needs:
- namespace-check
image: registry.gitlab.com/gitlab-org/release-cli:v0.19.0
script:
- |
echo "### Releasing namespace v${VERSION}"
if release-cli get --tag-name namespace/${VERSION}; then
echo " Already exists"
exit 0
else
release-cli create \
--name "namespace v${VERSION}" \
--description "Custom release of namespace v${VERSION}" \
--tag-name "namespace/${VERSION}" \
--ref "${CI_COMMIT_SHA}"
fi
49 changes: 49 additions & 0 deletions nodejs-lts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
nodejs-lts-check:
image: registry.gitlab.com/uniget-org/images/ubuntu:rolling
script:
- |
MAJOR_VERSION="$(
curl --silent --location --fail https://github.com/nodejs/Release/raw/main/schedule.json \
| jq -r 'to_entries[] | select(.value.maintenance > (now | todate)) | select(.value.lts != null) | select(.value.lts < (now | todate)) | .key'
)"
if test -z "${MAJOR_VERSION}"; then
echo "Failed to fetch latest tag and extract major version from release schedule"
exit 1
fi
echo "### Found LTS major version ${MAJOR_VERSION}"
VERSION="$(
git ls-remote https://github.com/nodejs/node "refs/tags/${MAJOR_VERSION}.*" \
| grep -v '\^{}' \
| cut -f2 | cut -d/ -f3 | tr -d v \
| sort -Vr | head -1
)"
if test -z "${VERSION}"; then
echo "Failed to fetch tag and extract version from GitHub"
exit 1
fi
echo "### Found LTS version ${VERSION}"
echo "version=${VERSION}" >>variables.env
artifacts:
reports:
dotenv: variables.env

nodejs-lts-release:
needs:
- nodejs-lts-check
image: registry.gitlab.com/gitlab-org/release-cli:v0.19.0
script:
- |
echo "### Releasing nodejs-lts v${VERSION}"
if release-cli get --tag-name nodejs-lts/${VERSION}; then
echo " Already exists"
exit 0
else
release-cli create \
--name "nodejs-lts v${VERSION}" \
--description "Custom release of nodejs-lts v${VERSION}" \
--tag-name "nodejs-lts/${VERSION}" \
--ref "${CI_COMMIT_SHA}"
fi
44 changes: 44 additions & 0 deletions passage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
passage-check:
image: registry.gitlab.com/uniget-org/images/ubuntu:rolling
script:
- |
git clone https://github.com/FiloSottile/passage
cd passage
VERSION="$(git rev-list --count --all)"
if test -z "${VERSION}"; then
echo "Failed to count commits"
exit 1
fi
COMMIT="$(git rev-parse --short HEAD)"
if test -z "${COMMIT}"; then
echo "Failed to get short commit hash"
exit 1
fi
echo "Got version <${VERSION}.${COMMIT}>"
echo "version=${VERSION}.${COMMIT}" >>variables.env
artifacts:
reports:
dotenv: variables.env

passage-release:
needs:
- passage-check
image: registry.gitlab.com/gitlab-org/release-cli:v0.19.0
script:
- |
echo "### Releasing passage v${VERSION}"
if release-cli get --tag-name passage/${VERSION}; then
echo " Already exists"
exit 0
else
release-cli create \
--name "passage v${VERSION}" \
--description "Custom release of passage v${VERSION}" \
--tag-name "passage/${VERSION}" \
--ref "${CI_COMMIT_SHA}"
fi
47 changes: 47 additions & 0 deletions python-3.12.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
python-3.12-check:
image: registry.gitlab.com/uniget-org/images/ubuntu:rolling
variables:
# renovate: datasource=github-releases depName=indygreg/python-build-standalone versioning=loose
INDYGREG_PYTHON_BUILD_STANDALONE_VERSION: 20241016
script:
- |
# Find cpython-${PYTHON_VERSION}+${version}-${arch}-unknown-linux-musl-install_only.tar.gz
VERSION="$(
curl --silent --show-error --location --fail \
--url "https://api.github.com/repos/indygreg/python-build-standalone/releases/tags/${INDYGREG_PYTHON_BUILD_STANDALONE_VERSION}" \
| jq --raw-output '.assets[].name' \
| grep -E -- '-x86_64-unknown-linux-musl-install_only.tar.gz$' \
| sed -E 's/^cpython-([^+]+)\+.+$/\1/' \
| grep -P '^3\.12\.\d+$' \
| sort -Vr \
| head -n 1
)"
if test -z "${VERSION}"; then
echo "Failed to fetch latest tag and extract version from GitHub"
exit 1
fi
echo "Got version <${VERSION}>"
echo "version=${VERSION}.${INDYGREG_PYTHON_BUILD_STANDALONE_VERSION}" >>variables.env
artifacts:
reports:
dotenv: variables.env

python-3.12-release:
needs:
- python-3.12-check
image: registry.gitlab.com/gitlab-org/release-cli:v0.19.0
script:
- |
echo "### Releasing python-3.12 v${VERSION}"
if release-cli get --tag-name python-3.12/${VERSION}; then
echo " Already exists"
exit 0
else
release-cli create \
--name "python-3.12 v${VERSION}" \
--description "Custom release of python-3.12 v${VERSION}" \
--tag-name "python-3.12/${VERSION}" \
--ref "${CI_COMMIT_SHA}"
fi
47 changes: 47 additions & 0 deletions python.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
k3s-check:
image: registry.gitlab.com/uniget-org/images/ubuntu:rolling
variables:
# renovate: datasource=github-releases depName=indygreg/python-build-standalone versioning=loose
INDYGREG_PYTHON_BUILD_STANDALONE_VERSION: 20241016
script:
- |
# Find cpython-${PYTHON_VERSION}+${version}-${arch}-unknown-linux-musl-install_only.tar.gz
VERSION="$(
curl --silent --show-error --location --fail \
--url "https://api.github.com/repos/indygreg/python-build-standalone/releases/tags/${INDYGREG_PYTHON_BUILD_STANDALONE_VERSION}" \
| jq --raw-output '.assets[].name' \
| grep -E -- '-x86_64-unknown-linux-musl-install_only.tar.gz$' \
| sed -E 's/^cpython-([^+]+)\+.+$/\1/' \
| grep -P '^\d+\.\d+\.\d+$' \
| sort -Vr \
| head -n 1
)"
if test -z "${VERSION}"; then
echo "Failed to fetch latest tag and extract version from GitHub"
exit 1
fi
echo "Got version <${VERSION}>"
echo "version=${VERSION}.${INDYGREG_PYTHON_BUILD_STANDALONE_VERSION}" >>variables.env
artifacts:
reports:
dotenv: variables.env

k3s-release:
needs:
- k3s-check
image: registry.gitlab.com/gitlab-org/release-cli:v0.19.0
script:
- |
echo "### Releasing k3s v${VERSION}"
if release-cli get --tag-name k3s/${VERSION}; then
echo " Already exists"
exit 0
else
release-cli create \
--name "k3s v${VERSION}" \
--description "Custom release of k3s v${VERSION}" \
--tag-name "k3s/${VERSION}" \
--ref "${CI_COMMIT_SHA}"
fi
7 changes: 2 additions & 5 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
"regexManagers:githubActionsVersions"
"regexManagers:githubActionsVersions",
"customManagers:gitlabPipelineVersions"
],
"packageRules": [
{
"matchDatasources": [ "github-actions" ],
"automerge": true
},
{
"matchPackageNames": [ "indygreg/python-build-standalone" ],
"ignoreTests": true,
Expand Down
39 changes: 39 additions & 0 deletions rke2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
rke2-check:
image: registry.gitlab.com/uniget-org/images/ubuntu:rolling
script:
- |
VERSION="$(
curl --silent --show-error --location --fail \
--url "https://api.github.com/repos/rancher/rke2/releases/latest" \
| jq --raw-output '.tag_name' \
| sed -E 's/^v([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+)\+rke2r([[:digit:]]+)$/\1.\2/'
)"
if test -z "${VERSION}"; then
echo "Failed to fetch latest tag and extract version from GitHub"
exit 1
fi
echo "Got version <${VERSION}>"
echo "version=${VERSION}" >>variables.env
artifacts:
reports:
dotenv: variables.env

rke2-release:
needs:
- rke2-check
image: registry.gitlab.com/gitlab-org/release-cli:v0.19.0
script:
- |
echo "### Releasing rke2 v${VERSION}"
if release-cli get --tag-name rke2/${VERSION}; then
echo " Already exists"
exit 0
else
release-cli create \
--name "rke2 v${VERSION}" \
--description "Custom release of rke2 v${VERSION}" \
--tag-name "rke2/${VERSION}" \
--ref "${CI_COMMIT_SHA}"
fi

0 comments on commit bdbf19e

Please sign in to comment.