Skip to content

Update module github.com/Masterminds/semver/v3 to v3.3.1 #449

Update module github.com/Masterminds/semver/v3 to v3.3.1

Update module github.com/Masterminds/semver/v3 to v3.3.1 #449

Workflow file for this run

name: Snapshot
on:
push:
branches:
- "**"
paths-ignore:
- .dockerignore
- .editorconfig
- .gitignore
- .hadolint.yaml
- .markdownlint.yaml
- .trunk/**
- LICENSE
- README.md
pull_request:
branches:
- main
workflow_dispatch: {}
jobs:
build:
name: Build
permissions:
id-token: write
contents: write
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- platform: linux/amd64
arch: amd64
- platform: linux/arm64
arch: arm64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Prepare environment variables
run: cat .github/.env >> $GITHUB_ENV
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.21.0 # datasource=github-releases depName=golang/go
- name: Set up QEMU
if: contains(matrix.platform, 'linux/arm64')
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Login to DockerHub
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
uses: docker/login-action@v3
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Calculate new version number
id: version
run: echo VERSION=$(make version) | tee -a $GITHUB_ENV | tee -a $GITHUB_OUTPUT
- name: Build binary
run: make download build
env:
GOOS: linux
GOARCH: ${{ matrix.arch }}
- name: Test binary
run: |
version=$(./gitlab-ci-semver-labels current)
if [[ -z $version ]]; then
echo -n "Initial: "; ./gitlab-ci-semver-labels bump initial
else
echo "Current: $version"
echo -n "Prelease: "; ./gitlab-ci-semver-labels bump patch --prerelease
echo -n "Patch: "; ./gitlab-ci-semver-labels bump patch
echo -n "Minor: "; ./gitlab-ci-semver-labels bump minor
echo -n "Major: "; ./gitlab-ci-semver-labels bump major
fi
- name: Build image
run: make image PLATFORM="${{ matrix.platform }}"
- name: Inspect container image
run: docker inspect "localhost:5000/$IMAGE_NAME" | jq -C .
- name: Test image
run: make test-image PLATFORM="${{ matrix.platform }}"
- name: Push to DockerHub
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
run: make push DOCKER_REPO="${DOCKER_REPO}" PLATFORM="${{ matrix.platform }}"
outputs:
version: ${{ steps.version.outputs.VERSION }}
tag:
name: Tag
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
needs: build
permissions:
id-token: write
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Prepare environment variables
run: cat .github/.env >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Reuse new version number
run: echo VERSION=${{ needs.build.outputs.version }} | tee -a $GITHUB_ENV
- name: Tag multiarch images
run: |
docker manifest create ${DOCKER_REPO}:v${VERSION} ${DOCKER_REPO}:v${VERSION}-linux-arm64 ${DOCKER_REPO}:v${VERSION}-linux-amd64
docker manifest push ${DOCKER_REPO}:v${VERSION}