mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-22 10:38:07 +01:00
Change the pre-release versioning scheme and associated environment variables (#26653)
This commit is contained in:
parent
072112867b
commit
f39847476c
5 changed files with 27 additions and 19 deletions
6
.github/workflows/build-container-image.yml
vendored
6
.github/workflows/build-container-image.yml
vendored
|
@ -8,7 +8,9 @@ on:
|
||||||
type: boolean
|
type: boolean
|
||||||
push_to_images:
|
push_to_images:
|
||||||
type: string
|
type: string
|
||||||
version_suffix:
|
version_prerelease:
|
||||||
|
type: string
|
||||||
|
version_metadata:
|
||||||
type: string
|
type: string
|
||||||
flavor:
|
flavor:
|
||||||
type: string
|
type: string
|
||||||
|
@ -83,7 +85,7 @@ jobs:
|
||||||
- uses: docker/build-push-action@v4
|
- uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
build-args: MASTODON_VERSION_SUFFIX=${{ inputs.version_suffix }}
|
build-args: MASTODON_VERSION_PRERELEASE=${{ inputs.version_prerelease }} MASTODON_VERSION_METADATA=${{ inputs.version_metadata }}
|
||||||
platforms: ${{ inputs.platforms }}
|
platforms: ${{ inputs.platforms }}
|
||||||
provenance: false
|
provenance: false
|
||||||
builder: ${{ steps.buildx.outputs.name || steps.buildx-native.outputs.name }}
|
builder: ${{ steps.buildx.outputs.name || steps.buildx-native.outputs.name }}
|
||||||
|
|
9
.github/workflows/build-nightly.yml
vendored
9
.github/workflows/build-nightly.yml
vendored
|
@ -16,9 +16,9 @@ jobs:
|
||||||
env:
|
env:
|
||||||
TZ: Etc/UTC
|
TZ: Etc/UTC
|
||||||
run: |
|
run: |
|
||||||
echo mastodon_version_suffix=nightly.$(date +'%Y-%m-%d')>> $GITHUB_OUTPUT
|
echo mastodon_version_prerelease=nightly.$(date +'%Y-%m-%d')>> $GITHUB_OUTPUT
|
||||||
outputs:
|
outputs:
|
||||||
suffix: ${{ steps.version_vars.outputs.mastodon_version_suffix }}
|
prerelease: ${{ steps.version_vars.outputs.mastodon_version_prerelease }}
|
||||||
|
|
||||||
build-image:
|
build-image:
|
||||||
needs: compute-suffix
|
needs: compute-suffix
|
||||||
|
@ -29,8 +29,7 @@ jobs:
|
||||||
push_to_images: |
|
push_to_images: |
|
||||||
tootsuite/mastodon
|
tootsuite/mastodon
|
||||||
ghcr.io/mastodon/mastodon
|
ghcr.io/mastodon/mastodon
|
||||||
# The `-` is important here, result will be v4.1.2-nightly.2022-03-05
|
version_prerelease: ${{ needs.compute-suffix.outputs.prerelease }}
|
||||||
version_suffix: -${{ needs.compute-suffix.outputs.suffix }}
|
|
||||||
labels: |
|
labels: |
|
||||||
org.opencontainers.image.description=Nightly build image used for testing purposes
|
org.opencontainers.image.description=Nightly build image used for testing purposes
|
||||||
flavor: |
|
flavor: |
|
||||||
|
@ -38,5 +37,5 @@ jobs:
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=edge
|
type=raw,value=edge
|
||||||
type=raw,value=nightly
|
type=raw,value=nightly
|
||||||
type=schedule,pattern=${{ needs.compute-suffix.outputs.suffix }}
|
type=schedule,pattern=${{ needs.compute-suffix.outputs.prerelease }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
6
.github/workflows/build-push-pr.yml
vendored
6
.github/workflows/build-push-pr.yml
vendored
|
@ -21,9 +21,9 @@ jobs:
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- id: version_vars
|
- id: version_vars
|
||||||
run: |
|
run: |
|
||||||
echo mastodon_version_suffix=+pr-${{ github.event.pull_request.number }}-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
|
echo mastodon_version_metadata=pr-${{ github.event.pull_request.number }}-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
|
||||||
outputs:
|
outputs:
|
||||||
suffix: ${{ steps.version_vars.outputs.mastodon_version_suffix }}
|
metadata: ${{ steps.version_vars.outputs.mastodon_version_metadata }}
|
||||||
|
|
||||||
build-image:
|
build-image:
|
||||||
needs: compute-suffix
|
needs: compute-suffix
|
||||||
|
@ -33,7 +33,7 @@ jobs:
|
||||||
use_native_arm64_builder: true
|
use_native_arm64_builder: true
|
||||||
push_to_images: |
|
push_to_images: |
|
||||||
ghcr.io/mastodon/mastodon
|
ghcr.io/mastodon/mastodon
|
||||||
version_suffix: ${{ needs.compute-suffix.outputs.suffix }}
|
version_metadata: ${{ needs.compute-suffix.outputs.metadata }}
|
||||||
flavor: |
|
flavor: |
|
||||||
latest=auto
|
latest=auto
|
||||||
tags: |
|
tags: |
|
||||||
|
|
|
@ -42,8 +42,8 @@ RUN apt-get update && \
|
||||||
FROM node:${NODE_VERSION}
|
FROM node:${NODE_VERSION}
|
||||||
|
|
||||||
# Use those args to specify your own version flags & suffixes
|
# Use those args to specify your own version flags & suffixes
|
||||||
ARG MASTODON_VERSION_FLAGS=""
|
ARG MASTODON_VERSION_PRERELEASE=""
|
||||||
ARG MASTODON_VERSION_SUFFIX=""
|
ARG MASTODON_VERSION_METADATA=""
|
||||||
|
|
||||||
ARG UID="991"
|
ARG UID="991"
|
||||||
ARG GID="991"
|
ARG GID="991"
|
||||||
|
@ -89,8 +89,8 @@ ENV RAILS_ENV="production" \
|
||||||
NODE_ENV="production" \
|
NODE_ENV="production" \
|
||||||
RAILS_SERVE_STATIC_FILES="true" \
|
RAILS_SERVE_STATIC_FILES="true" \
|
||||||
BIND="0.0.0.0" \
|
BIND="0.0.0.0" \
|
||||||
MASTODON_VERSION_FLAGS="${MASTODON_VERSION_FLAGS}" \
|
MASTODON_VERSION_PRERELEASE="${MASTODON_VERSION_PRERELEASE}" \
|
||||||
MASTODON_VERSION_SUFFIX="${MASTODON_VERSION_SUFFIX}"
|
MASTODON_VERSION_METADATA="${MASTODON_VERSION_METADATA}"
|
||||||
|
|
||||||
# Set the run user
|
# Set the run user
|
||||||
USER mastodon
|
USER mastodon
|
||||||
|
|
|
@ -16,12 +16,16 @@ module Mastodon
|
||||||
0
|
0
|
||||||
end
|
end
|
||||||
|
|
||||||
def flags
|
def default_prerelease
|
||||||
ENV['MASTODON_VERSION_FLAGS'].presence || '-beta2'
|
'beta2'
|
||||||
end
|
end
|
||||||
|
|
||||||
def suffix
|
def prerelease
|
||||||
ENV.fetch('MASTODON_VERSION_SUFFIX', '')
|
ENV['MASTODON_VERSION_PRERELEASE'].presence || default_prerelease
|
||||||
|
end
|
||||||
|
|
||||||
|
def build_metadata
|
||||||
|
ENV.fetch('MASTODON_VERSION_METADATA', nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_a
|
def to_a
|
||||||
|
@ -29,7 +33,10 @@ module Mastodon
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
[to_a.join('.'), flags, suffix].join
|
components = [to_a.join('.')]
|
||||||
|
components << "-#{prerelease}" if prerelease.present?
|
||||||
|
components << "+#{build_metadata}" if build_metadata.present?
|
||||||
|
components.join
|
||||||
end
|
end
|
||||||
|
|
||||||
def repository
|
def repository
|
||||||
|
|
Loading…
Reference in a new issue