Skip to content

patch(deps): bump golang from 1.22.4-alpine to 1.22.5-alpine #992

patch(deps): bump golang from 1.22.4-alpine to 1.22.5-alpine

patch(deps): bump golang from 1.22.4-alpine to 1.22.5-alpine #992

Workflow file for this run

name: actions
on:
push:
paths-ignore:
- README.md
- LICENSE.md
- 'docs/**'
- '.github/workflows/codeql-analysis.yaml'
- '.github/workflows/devcontainer-ci.yaml'
- '.github/dependabot.yaml'
- '.gitignore'
branches:
- root
pull_request:
paths-ignore:
- README.md
- LICENSE.md
- 'docs/**'
- '.github/workflows/codeql-analysis.yaml'
- '.github/workflows/devcontainer-ci.yaml'
- '.github/dependabot.yaml'
- '.gitignore'
workflow_dispatch:
jobs:
initial-build:
runs-on: ubuntu-latest
steps:
- run: echo "Starting build pipeline for jjversion."
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- run: git log --oneline
- run: ls -al
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: '1.22.4'
- run: go vet
- run: go test ./...
- run: go build -a -v -o jjversion
- run: sudo mv jjversion /usr/local/bin
- run: jjversion
- run: echo "VERSION=$(jjversion | jq --raw-output '.MajorMinorPatch')" >> $GITHUB_ENV
- run: sudo rm /usr/local/bin/jjversion
- run: go build -a -v -o jjversion -ldflags "-X main.appVersion=${{ env.VERSION }}"
- run: sudo cp jjversion /usr/local/bin
- run: jjversion
- run: jjversion --version
- run: jjversion --help
- name: Upload jjversion
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: jjversion
path: jjversion
docker-build:
runs-on: ubuntu-latest
needs: initial-build
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Setup Docker BuildKit
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- name: Download jjversion
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion
- run: chmod +x jjversion
- run: sudo mv jjversion /usr/local/bin
- run: jjversion
- run: echo "VERSION=$(jjversion | jq --raw-output '.MajorMinorPatch')" >> $GITHUB_ENV
- run: |
docker build -t jjliggett/jjversion . \
--build-arg BUILD_VERSION="${{ env.VERSION }}" \
--label "org.opencontainers.image.created=$(date +%Y-%m-%dT%H:%M:%S%z)" \
--label "org.opencontainers.image.version=${{ env.VERSION }}" \
--label "org.opencontainers.image.authors=jjliggett" \
--label "org.opencontainers.image.url=https://github.com/jjliggett/jjversion" \
--label "org.opencontainers.image.documentation=https://github.com/jjliggett/jjversion" \
--label "org.opencontainers.image.source=https://github.com/jjliggett/jjversion" \
--label "org.opencontainers.image.revision=$(git rev-parse HEAD)" \
--label "org.opencontainers.image.title=jjversion" \
--label "org.opencontainers.image.description=A basic versioning utility to version git projects"
- run: docker inspect jjliggett/jjversion
- run: docker run --rm -v "$(pwd):/repo" jjliggett/jjversion
- run: docker run --rm jjliggett/jjversion jjversion --version
- run: docker save jjliggett/jjversion > jjversion.tar
- name: Upload jjversion.tar
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: jjversion.tar
path: jjversion.tar
docker-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Setup Docker BuildKit
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- run: docker build -f Dockerfile.test -t jjliggett/jjversion-test .
- run: docker run --rm jjliggett/jjversion-test
- run: make test
build-cross-compilation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: '1.22.4'
- run: go install
- run: go build -a -v -o jjversion
- run: sudo mv jjversion /usr/local/bin
- run: jjversion
- run: echo "VERSION=$(jjversion | jq --raw-output '.MajorMinorPatch')" >> $GITHUB_ENV
- run: echo "MAJOR=$(jjversion | jq --raw-output '.Major')" >> $GITHUB_ENV
- run: echo "MINOR=$(jjversion | jq --raw-output '.Minor')" >> $GITHUB_ENV
- run: echo "PATCH=$(jjversion | jq --raw-output '.Patch')" >> $GITHUB_ENV
- run: go build -a -v -o jjversion-${{ env.VERSION }}-linux-x64/jjversion -ldflags "-X main.appVersion=${{ env.VERSION }}"
- run: env GOARCH=arm64 go build -a -v -o jjversion-${{ env.VERSION }}-linux-arm64/jjversion -ldflags "-X main.appVersion=${{ env.VERSION }}"
- run: env GOARCH=arm go build -a -v -o jjversion-${{ env.VERSION }}-linux-arm/jjversion -ldflags "-X main.appVersion=${{ env.VERSION }}"
- run: env GOARCH=386 go build -a -v -o jjversion-${{ env.VERSION }}-linux-386/jjversion -ldflags "-X main.appVersion=${{ env.VERSION }}"
- run: env GOOS=darwin GOARCH=amd64 go build -a -v -o jjversion-${{ env.VERSION }}-darwin-amd64/jjversion -ldflags "-X main.appVersion=${{ env.VERSION }}"
# Set goversioninfo configuration for version and build Windows executables
- name: Change goversioninfo in jjversion.go
run: sed -i "s/\/\/go:generate goversioninfo/\/\/go:generate goversioninfo -file-version=${{ env.VERSION }} -product-version=${{ env.VERSION }} -ver-major=${{ env.MAJOR }} -ver-minor=${{ env.MINOR }} -ver-patch=${{ env.PATCH }} -ver-build=0 -product-ver-major=${{ env.MAJOR }} -product-ver-minor=${{ env.MINOR }} -product-ver-patch=${{ env.PATCH }} -product-ver-build=0/g" jjversion.go
- run: echo $PATH
- run: go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest
- run: go env
# https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#adding-a-system-path
- run: echo "/home/runner/go/bin" >> $GITHUB_PATH
- run: echo $PATH
- run: go generate
- run: env GOOS=windows GOARCH=386 go build -a -v -o jjversion-${{ env.VERSION }}-windows-386/jjversion.exe -ldflags "-X main.appVersion=${{ env.VERSION }}"
- run: env GOOS=windows GOARCH=amd64 go build -a -v -o jjversion-${{ env.VERSION }}-windows-x64/jjversion.exe -ldflags "-X main.appVersion=${{ env.VERSION }}"
- run: rm resource.syso
- run: env GOOS=windows GOARCH=arm go build -a -v -o jjversion-${{ env.VERSION }}-windows-arm/jjversion.exe -ldflags "-X main.appVersion=${{ env.VERSION }}"
- name: Upload jjversion docs
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: jjversion-${{ env.VERSION }}-docs
path: docs/
- name: Upload jjversion linux x64
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: jjversion-${{ env.VERSION }}-linux-x64
path: jjversion-${{ env.VERSION }}-linux-x64/
- name: Upload jjversion linux arm64
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: jjversion-${{ env.VERSION }}-linux-arm64
path: jjversion-${{ env.VERSION }}-linux-arm64/
- name: Upload jjversion linux arm
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: jjversion-${{ env.VERSION }}-linux-arm
path: jjversion-${{ env.VERSION }}-linux-arm/
- name: Upload jjversion linux 386
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: jjversion-${{ env.VERSION }}-linux-386
path: jjversion-${{ env.VERSION }}-linux-386/
- name: Upload jjversion darwin amd64
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: jjversion-${{ env.VERSION }}-darwin-amd64
path: jjversion-${{ env.VERSION }}-darwin-amd64/
- name: Upload jjversion windows x64
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: jjversion-${{ env.VERSION }}-windows-x64
path: jjversion-${{ env.VERSION }}-windows-x64/
- name: Upload jjversion windows 386
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: jjversion-${{ env.VERSION }}-windows-386
path: jjversion-${{ env.VERSION }}-windows-386/
- name: Upload jjversion windows arm
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: jjversion-${{ env.VERSION }}-windows-arm
path: jjversion-${{ env.VERSION }}-windows-arm/
publish:
runs-on: ubuntu-latest
needs:
- initial-build
- docker-build
- docker-test
- test-release-branch
- test-release-branch-and-tag
- test-commit-incrementing
- test-commit-tags-annotated-highest
- test-commit-tags-lightweight-highest
- test-docker-release-branch
- test-docker-release-branch-and-tag
- test-docker-commit-incrementing
- test-docker-commit-tags-annotated-highest
- test-docker-commit-tags-lightweight-highest
- test-commit-incrementing-custom-versioning-settings
- test-commit-incrementing-no-settings
- build-cross-compilation
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Download jjversion
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion
- run: chmod +x jjversion
- run: sudo mv jjversion /usr/local/bin
- run: jjversion
- run: echo "VERSION=$(jjversion | jq --raw-output '.MajorMinorPatch')" >> $GITHUB_ENV
- run: git reset --soft HEAD~1
- run: echo "PREVIOUS_COMMIT_VERSION=$(jjversion | jq --raw-output '.MajorMinorPatch')" >> $GITHUB_ENV
- name: Download jjversion linux x64
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion-${{ env.VERSION }}-linux-x64
path: jjversion-${{ env.VERSION }}-linux-x64/
- name: Download jjversion linux arm64
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion-${{ env.VERSION }}-linux-arm64
path: jjversion-${{ env.VERSION }}-linux-arm64/
- name: Download jjversion linux arm
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion-${{ env.VERSION }}-linux-arm
path: jjversion-${{ env.VERSION }}-linux-arm/
- name: Download jjversion linux 386
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion-${{ env.VERSION }}-linux-386
path: jjversion-${{ env.VERSION }}-linux-386/
- name: Download jjversion darwin amd64
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion-${{ env.VERSION }}-darwin-amd64
path: jjversion-${{ env.VERSION }}-darwin-amd64/
- name: Download jjversion windows x64
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion-${{ env.VERSION }}-windows-x64
path: jjversion-${{ env.VERSION }}-windows-x64/
- name: Download jjversion windows 386
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion-${{ env.VERSION }}-windows-386
path: jjversion-${{ env.VERSION }}-windows-386/
- name: Download jjversion windows arm
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion-${{ env.VERSION }}-windows-arm
path: jjversion-${{ env.VERSION }}-windows-arm/
# Prepare directories - copy README.md, LICENSE.md, and docs (attributions)
- run: cp README.md jjversion-${{ env.VERSION }}-linux-x64/jjversion-README.md
- run: cp LICENSE.md jjversion-${{ env.VERSION }}-linux-x64/jjversion-LICENSE.md
- run: cp -R docs jjversion-${{ env.VERSION }}-linux-x64/jjversion-docs
- run: cp README.md jjversion-${{ env.VERSION }}-linux-arm64/jjversion-README.md
- run: cp LICENSE.md jjversion-${{ env.VERSION }}-linux-arm64/jjversion-LICENSE.md
- run: cp -R docs jjversion-${{ env.VERSION }}-linux-arm64/jjversion-docs
- run: cp README.md jjversion-${{ env.VERSION }}-linux-arm/jjversion-README.md
- run: cp LICENSE.md jjversion-${{ env.VERSION }}-linux-arm/jjversion-LICENSE.md
- run: cp -R docs jjversion-${{ env.VERSION }}-linux-arm/jjversion-docs
- run: cp README.md jjversion-${{ env.VERSION }}-linux-386/jjversion-README.md
- run: cp LICENSE.md jjversion-${{ env.VERSION }}-linux-386/jjversion-LICENSE.md
- run: cp -R docs jjversion-${{ env.VERSION }}-linux-386/jjversion-docs
- run: cp README.md jjversion-${{ env.VERSION }}-darwin-amd64/jjversion-README.md
- run: cp LICENSE.md jjversion-${{ env.VERSION }}-darwin-amd64/jjversion-LICENSE.md
- run: cp -R docs jjversion-${{ env.VERSION }}-darwin-amd64/jjversion-docs
- run: cp README.md jjversion-${{ env.VERSION }}-windows-x64/jjversion-README.md
- run: cp LICENSE.md jjversion-${{ env.VERSION }}-windows-x64/jjversion-LICENSE.md
- run: cp -R docs jjversion-${{ env.VERSION }}-windows-x64/jjversion-docs
- run: cp README.md jjversion-${{ env.VERSION }}-windows-386/jjversion-README.md
- run: cp LICENSE.md jjversion-${{ env.VERSION }}-windows-386/jjversion-LICENSE.md
- run: cp -R docs jjversion-${{ env.VERSION }}-windows-386/jjversion-docs
- run: cp README.md jjversion-${{ env.VERSION }}-windows-arm/jjversion-README.md
- run: cp LICENSE.md jjversion-${{ env.VERSION }}-windows-arm/jjversion-LICENSE.md
- run: cp -R docs jjversion-${{ env.VERSION }}-windows-arm/jjversion-docs
- run: zip -r jjversion-${{ env.VERSION }}-docs.zip docs
- run: zip -r jjversion-${{ env.VERSION }}-linux-x64.zip jjversion-${{ env.VERSION }}-linux-x64
- run: zip -r jjversion-${{ env.VERSION }}-linux-arm64.zip jjversion-${{ env.VERSION }}-linux-arm64
- run: zip -r jjversion-${{ env.VERSION }}-linux-arm.zip jjversion-${{ env.VERSION }}-linux-arm
- run: zip -r jjversion-${{ env.VERSION }}-linux-386.zip jjversion-${{ env.VERSION }}-linux-386
- run: zip -r jjversion-${{ env.VERSION }}-darwin-amd64.zip jjversion-${{ env.VERSION }}-darwin-amd64
- run: zip -r jjversion-${{ env.VERSION }}-windows-x64.zip jjversion-${{ env.VERSION }}-windows-x64
- run: zip -r jjversion-${{ env.VERSION }}-windows-386.zip jjversion-${{ env.VERSION }}-windows-386
- run: zip -r jjversion-${{ env.VERSION }}-windows-arm.zip jjversion-${{ env.VERSION }}-windows-arm
- run: zip jjversion-${{ env.VERSION }}-artifacts.zip jjversion-${{ env.VERSION }}-linux-x64.zip jjversion-${{ env.VERSION }}-linux-arm64.zip jjversion-${{ env.VERSION }}-linux-arm.zip jjversion-${{ env.VERSION }}-linux-386.zip jjversion-${{ env.VERSION }}-darwin-amd64.zip jjversion-${{ env.VERSION }}-windows-x64.zip jjversion-${{ env.VERSION }}-windows-386.zip jjversion-${{ env.VERSION }}-windows-arm.zip
- run: ls -R
- name: Upload jjversion
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: jjversion-${{ env.VERSION }}-artifacts.zip
path: jjversion-${{ env.VERSION }}-artifacts.zip
- name: Download jjversion.tar
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion.tar
- run: docker load < jjversion.tar
- run: docker tag jjliggett/jjversion "jjliggett/jjversion:${{ env.VERSION }}"
- run: docker tag jjliggett/jjversion "ghcr.io/jjliggett/jjversion:${{ env.VERSION }}"
- run: docker tag jjliggett/jjversion "ghcr.io/jjliggett/jjversion:latest"
- run: docker images
- run: echo "The Docker image with this version has not been published yet. The image will be uploaded on the root branch."
if: ${{ env.VERSION != env.PREVIOUS_COMMIT_VERSION }}
- run: echo "The Docker image with this version has already been published. The image will not be uploaded on the root branch."
if: ${{ env.VERSION == env.PREVIOUS_COMMIT_VERSION }}
- name: Login to GitHub Container Registry
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
if: ${{ github.ref == 'refs/heads/root' }}
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_PUBLISH_TOKEN }}
- run: docker push "ghcr.io/jjliggett/jjversion:${{ env.VERSION }}"
if: ${{ github.ref == 'refs/heads/root' && env.VERSION != env.PREVIOUS_COMMIT_VERSION }}
- run: docker push "ghcr.io/jjliggett/jjversion:latest"
if: ${{ github.ref == 'refs/heads/root' && env.VERSION != env.PREVIOUS_COMMIT_VERSION }}
- name: Login to Docker Hub
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
if: ${{ github.ref == 'refs/heads/root' && env.VERSION != env.PREVIOUS_COMMIT_VERSION }}
with:
registry: docker.io
username: jjliggett
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- run: docker push "jjliggett/jjversion:${{ env.VERSION }}"
if: ${{ github.ref == 'refs/heads/root' && env.VERSION != env.PREVIOUS_COMMIT_VERSION }}
- run: docker push jjliggett/jjversion
if: ${{ github.ref == 'refs/heads/root' && env.VERSION != env.PREVIOUS_COMMIT_VERSION }}
- name: Create GitHub release
uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0 # v2.0.6
if: ${{ github.ref == 'refs/heads/root' && env.VERSION != env.PREVIOUS_COMMIT_VERSION }}
with:
token: "${{ secrets.GH_PUBLISH_TOKEN }}"
draft: false
prerelease: false
tag_name: v${{ env.VERSION }}
generate_release_notes: true
make_latest: true
files: |
jjversion-${{ env.VERSION }}-linux-x64.zip
jjversion-${{ env.VERSION }}-linux-arm64.zip
jjversion-${{ env.VERSION }}-linux-arm.zip
jjversion-${{ env.VERSION }}-linux-386.zip
jjversion-${{ env.VERSION }}-darwin-amd64.zip
jjversion-${{ env.VERSION }}-windows-x64.zip
jjversion-${{ env.VERSION }}-windows-386.zip
jjversion-${{ env.VERSION }}-windows-arm.zip
README.md
LICENSE.md
jjversion-${{ env.VERSION }}-docs.zip
test-release-branch:
runs-on: ubuntu-latest
needs: initial-build
steps:
- run: mkdir repo && cd repo
- run: git init
- run: git config user.email "user@example.com"
- run: git config user.name "user"
- run: git checkout -b release/10.42.11
- run: git commit -m "initial commit" --allow-empty
- name: Download jjversion
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion
- run: chmod +x jjversion
- run: ls -R -al
- run: sudo cp jjversion /usr/local/bin
- run: jjversion
- run: jjversion | jq --raw-output '.MajorMinorPatch' | grep 10.42.11
- run: jjversion | jq --raw-output '.Major' | grep 10
- run: jjversion | jq --raw-output '.Minor' | grep 42
- run: jjversion | jq --raw-output '.Patch' | grep 11
- run: jjversion | jq --raw-output '.Sha' | grep $(git rev-parse HEAD)
test-release-branch-and-tag:
runs-on: ubuntu-latest
needs: initial-build
steps:
- run: mkdir repo && cd repo
- run: git init
- run: git config user.email "user@example.com"
- run: git config user.name "user"
- run: git checkout -b release/10.42.11
- run: git commit -m "initial commit" --allow-empty
- run: git tag v42.43.44
- run: git tag -a v100.100.100 -m "v100.100.100"
- name: Download jjversion
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion
- run: chmod +x jjversion
- run: ls -R -al
- run: sudo cp jjversion /usr/local/bin
- run: jjversion | jq --raw-output '.MajorMinorPatch' | grep 10.42.11
test-commit-incrementing:
runs-on: ubuntu-latest
needs: initial-build
steps:
- name: Download jjversion
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion
- run: chmod +x jjversion
- run: sudo mv jjversion /usr/local/bin
- run: mkdir repo && cd repo
- run: git init
- run: git config user.email "user@example.com"
- run: git config user.name "user"
- run: |
echo "commit_message_incrementing_enabled: true" >> versioning.yaml
git commit -m "minor: initial commit" --allow-empty
git commit -m "patch: fix small bug" --allow-empty
git commit -m "patch: fix another bug" --allow-empty
- run: jjversion
- run: jjversion | jq --raw-output '.MajorMinorPatch' | grep 0.1.2
- run: |
git commit -m "minor: added a feature" --allow-empty
git commit -m "minor: added another feature" --allow-empty
- run: jjversion | jq --raw-output '.MajorMinorPatch' | grep 0.3.0
- run: |
git commit -m "major: breaking changes etc." --allow-empty
git commit -m "minor: added new option" --allow-empty
git commit -m "minor: added another option" --allow-empty
git commit -m "patch: fixed a bug" --allow-empty
- run: jjversion
- run: jjversion | jq --raw-output '.MajorMinorPatch' | grep 0.6.1
- run: |
git commit -m "major: release 1.0.0" --allow-empty
git tag v1.0.0
git commit -m "minor: added another feature" --allow-empty
git commit -m "major: breaking changes" --allow-empty
git commit -m "minor: small update" --allow-empty
git commit -m "patch: bugfix for etc." --allow-empty
- run: jjversion
- run: jjversion | jq --raw-output '.MajorMinorPatch' | grep 2.1.1
test-commit-tags-annotated-highest:
runs-on: ubuntu-latest
needs: initial-build
steps:
- name: Download jjversion
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion
- run: chmod +x jjversion
- run: sudo mv jjversion /usr/local/bin
- run: mkdir repo && cd repo
- run: git init
- run: git config user.email "user@example.com"
- run: git config user.name "user"
- run: |
git commit -m "Initial commit" --allow-empty
git tag v0.0.1
git tag v0.1.0
git tag -a "v0.0.10" -m "v0.0.10"
git tag -a "v1.0.0" -m "v1.0.0"
git tag -a "v0.10.0" -m "v0.10.0"
git tag v0.11.0
- run: git show --quiet HEAD
- run: git tag -n
- run: git show-ref --tags -d
- run: jjversion
- run: jjversion | jq --raw-output '.MajorMinorPatch' | grep 1.0.0
test-commit-tags-lightweight-highest:
runs-on: ubuntu-latest
needs: initial-build
steps:
- name: Download jjversion
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion
- run: chmod +x jjversion
- run: sudo mv jjversion /usr/local/bin
- run: mkdir repo && cd repo
- run: git init
- run: git config user.email "user@example.com"
- run: git config user.name "user"
- run: |
git commit -m "Initial commit" --allow-empty
git tag v0.0.1
git tag v0.1.0
git tag -a "v0.0.10" -m "v0.0.10"
git tag v1.1.1
git tag -a "v1.0.0" -m "v1.0.0"
git tag -a "v0.10.0" -m "v0.10.0"
git tag v0.11.0
- run: git show --quiet HEAD
- run: git tag -n
- run: git show-ref --tags -d
- run: jjversion
- run: jjversion | jq --raw-output '.MajorMinorPatch' | grep 1.1.1
test-docker-release-branch:
runs-on: ubuntu-latest
needs: docker-build
steps:
- run: mkdir repo && cd repo
- run: git init
- run: git config user.email "user@example.com"
- run: git config user.name "user"
- run: git checkout -b release/10.42.11
- run: git commit -m "initial commit" --allow-empty
- name: Download jjversion.tar
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion.tar
- run: docker load < jjversion.tar
- run: docker run --rm -v "$(pwd):/repo" jjliggett/jjversion
- run: docker run --rm -v "$(pwd):/repo" jjliggett/jjversion | jq --raw-output '.MajorMinorPatch' | grep 10.42.11
- run: docker run --rm -v "$(pwd):/repo" jjliggett/jjversion | jq --raw-output '.Major' | grep 10
- run: docker run --rm -v "$(pwd):/repo" jjliggett/jjversion | jq --raw-output '.Minor' | grep 42
- run: docker run --rm -v "$(pwd):/repo" jjliggett/jjversion | jq --raw-output '.Patch' | grep 11
- run: docker run --rm -v "$(pwd):/repo" jjliggett/jjversion | jq --raw-output '.Sha' | grep $(git rev-parse HEAD)
test-docker-release-branch-and-tag:
runs-on: ubuntu-latest
needs: docker-build
steps:
- run: mkdir repo && cd repo
- run: git init
- run: git config user.email "user@example.com"
- run: git config user.name "user"
- run: git checkout -b release/10.42.11
- run: git commit -m "initial commit" --allow-empty
- run: git tag v42.43.44
- run: git tag -a v100.100.100 -m "v100.100.100"
- name: Download jjversion.tar
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion.tar
- run: docker load < jjversion.tar
- run: docker run --rm -v "$(pwd):/repo" jjliggett/jjversion | jq --raw-output '.MajorMinorPatch' | grep 10.42.11
test-docker-commit-incrementing:
runs-on: ubuntu-latest
needs: docker-build
steps:
- name: Download jjversion.tar
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion.tar
- run: docker load < jjversion.tar
- run: mkdir repo && cd repo
- run: git init
- run: git config user.email "user@example.com"
- run: git config user.name "user"
- run: |
echo "commit_message_incrementing_enabled: true" >> versioning.yaml
git commit -m "minor: initial commit" --allow-empty
git commit -m "patch: fix small bug" --allow-empty
git commit -m "patch: fix another bug" --allow-empty
- run: docker run --rm -v "$(pwd):/repo" jjliggett/jjversion
- run: docker run --rm -v "$(pwd):/repo" jjliggett/jjversion | jq --raw-output '.MajorMinorPatch' | grep 0.1.2
- run: |
git commit -m "minor: added a feature" --allow-empty
git commit -m "minor: added another feature" --allow-empty
- run: docker run --rm -v "$(pwd):/repo" jjliggett/jjversion | jq --raw-output '.MajorMinorPatch' | grep 0.3.0
- run: |
git commit -m "major: breaking changes etc." --allow-empty
git commit -m "minor: added new option" --allow-empty
git commit -m "minor: added another option" --allow-empty
git commit -m "patch: fixed a bug" --allow-empty
- run: docker run --rm -v "$(pwd):/repo" jjliggett/jjversion
- run: docker run --rm -v "$(pwd):/repo" jjliggett/jjversion | jq --raw-output '.MajorMinorPatch' | grep 0.6.1
- run: |
git commit -m "major: release 1.0.0" --allow-empty
git tag v1.0.0
git commit -m "minor: added another feature" --allow-empty
git commit -m "major: breaking changes" --allow-empty
git commit -m "minor: small update" --allow-empty
git commit -m "patch: bugfix for etc." --allow-empty
- run: docker run --rm -v "$(pwd):/repo" jjliggett/jjversion
- run: docker run --rm -v "$(pwd):/repo" jjliggett/jjversion | jq --raw-output '.MajorMinorPatch' | grep 2.1.1
test-docker-commit-tags-annotated-highest:
runs-on: ubuntu-latest
needs: docker-build
steps:
- name: Download jjversion.tar
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion.tar
- run: docker load < jjversion.tar
- run: mkdir repo && cd repo
- run: git init
- run: git config user.email "user@example.com"
- run: git config user.name "user"
- run: |
git commit -m "Initial commit" --allow-empty
git tag v0.0.1
git tag v0.1.0
git tag -a "v0.0.10" -m "v0.0.10"
git tag -a "v1.0.0" -m "v1.0.0"
git tag -a "v0.10.0" -m "v0.10.0"
git tag v0.11.0
- run: git show --quiet HEAD
- run: git tag -n
- run: git show-ref --tags -d
- run: docker run --rm -v "$(pwd):/repo" jjliggett/jjversion
- run: docker run --rm -v "$(pwd):/repo" jjliggett/jjversion | jq --raw-output '.MajorMinorPatch' | grep 1.0.0
test-docker-commit-tags-lightweight-highest:
runs-on: ubuntu-latest
needs: docker-build
steps:
- name: Download jjversion.tar
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion.tar
- run: docker load < jjversion.tar
- run: mkdir repo && cd repo
- run: git init
- run: git config user.email "user@example.com"
- run: git config user.name "user"
- run: |
git commit -m "Initial commit" --allow-empty
git tag v0.0.1
git tag v0.1.0
git tag -a "v0.0.10" -m "v0.0.10"
git tag v1.1.1
git tag -a "v1.0.0" -m "v1.0.0"
git tag -a "v0.10.0" -m "v0.10.0"
git tag v0.11.0
- run: git show --quiet HEAD
- run: git tag -n
- run: git show-ref --tags -d
- run: docker run --rm -v "$(pwd):/repo" jjliggett/jjversion
- run: docker run --rm -v "$(pwd):/repo" jjliggett/jjversion | jq --raw-output '.MajorMinorPatch' | grep 1.1.1
test-commit-incrementing-custom-versioning-settings:
runs-on: ubuntu-latest
needs: initial-build
steps:
- name: Download jjversion
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion
- run: chmod +x jjversion
- run: sudo mv jjversion /usr/local/bin
- run: mkdir repo && cd repo
- run: git init
- run: git config user.email "user@example.com"
- run: git config user.name "user"
- run: |
echo "commit_message_incrementing_enabled: true" >> versioning.yaml
echo "major_version_bump_message: '^((first):)'" >> versioning.yaml
echo "minor_version_bump_message: '^((second):)'" >> versioning.yaml
echo "patch_version_bump_message: '^((third):)'" >> versioning.yaml
git commit -m "second: initial commit" --allow-empty
git commit -m "minor: commit" --allow-empty
git commit -m "third: fix small bug" --allow-empty
git commit -m "third: fix another bug" --allow-empty
git commit -m "patch: fix small bug" --allow-empty
git commit -m "patch: fix another bug" --allow-empty
- run: jjversion
- run: jjversion | jq --raw-output '.MajorMinorPatch' | grep 0.1.2
- run: |
git commit -m "first: release 1.0.0" --allow-empty
git tag v1.0.0
git commit -m "first: major commit" --allow-empty
git commit -m "major: major commit" --allow-empty
git commit -m "third: bugfix" --allow-empty
- run: jjversion
- run: jjversion | jq --raw-output '.MajorMinorPatch' | grep 2.0.1
test-commit-incrementing-no-settings:
runs-on: ubuntu-latest
needs: initial-build
steps:
- name: Download jjversion
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: jjversion
- run: chmod +x jjversion
- run: sudo mv jjversion /usr/local/bin
- run: mkdir repo && cd repo
- run: git init
- run: git config user.email "user@example.com"
- run: git config user.name "user"
- run: |
git commit -m "minor: initial commit" --allow-empty
git commit -m "patch: fix small bug" --allow-empty
git commit -m "patch: fix another bug" --allow-empty
- run: jjversion
- run: jjversion | jq --raw-output '.MajorMinorPatch' | grep 0.0.0