Skip to content

fix(deps): update module github.com/spf13/cobra to v1.8.1 #126

fix(deps): update module github.com/spf13/cobra to v1.8.1

fix(deps): update module github.com/spf13/cobra to v1.8.1 #126

Workflow file for this run

name: Build and Push
on:
workflow_dispatch:
push:
paths-ignore:
- "action.yml"
- "website/**"
permissions:
packages: write
contents: write
jobs:
generate-version:
runs-on: ubuntu-latest
outputs:
trunkver: ${{ steps.trunkver.outputs.trunkver }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Generate trunkver
id: trunkver
uses: crftd-tech/trunkver@main
with:
baseVersion: "1.0.0"
prerelease: "true"
build-release:
runs-on: ubuntu-latest
needs: [generate-version]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22
- name: Build trunkver
env:
VERSION: ${{ needs.generate-version.outputs.trunkver }}
run: |
(
unset GITHUB_SHA
unset GITHUB_RUN_ID
make test all spec "VERSION=${VERSION}"
)
- name: Create release
id: release
uses: softprops/action-gh-release@v2
if: github.ref == 'refs/heads/main'
with:
name: ${{ needs.generate-version.outputs.trunkver }}
tag_name: ${{ needs.generate-version.outputs.trunkver }}
files: |
out/trunkver*
build-docker:
runs-on: ubuntu-latest
needs: [generate-version]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Generate metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/crftd-tech/trunkver
tags: |
type=raw,value=${{ needs.generate-version.outputs.trunkver }}
type=raw,value=latest
- name: Log in to the Container registry
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446
with:
registry: "ghcr.io"
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@86c2bd00318427a320d2cee5bbc61251df6f647e
with:
context: .
push: ${{ github.ref == 'refs/heads/main' }}
build-args: |
VERSION=${{ needs.generate-version.outputs.trunkver }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Update the action.yml with the new image tag
if: github.ref == 'refs/heads/main'
run: |
yq eval --inplace '.runs.image = "docker://ghcr.io/crftd-tech/trunkver:${{ needs.generate-version.outputs.trunkver }}"' action.yml
git config --global user.email "bot@crftd.tech"
git config --global user.name "crftd-bot"
git add action.yml
git commit -m "chore: Bump image tag in action.yml"
git push