diff --git a/.github/workflows/docker-image-update.yml b/.github/workflows/docker-image-update.yml index 60bd8d93..ab43b728 100644 --- a/.github/workflows/docker-image-update.yml +++ b/.github/workflows/docker-image-update.yml @@ -13,17 +13,18 @@ jobs: max-parallel: 3 matrix: os: [ubuntu-latest, windows-2022] - buildArgs: VERSION=${{ github.ref_name }} include: - os: ubuntu-latest platforms: linux/amd64,linux/arm/v7,linux/arm64 file: linux.Dockerfile + buildArgs: VERSION=${{ github.event.workflow_run.head_branch }} tags: latest, ${{ github.event.workflow_run.head_branch }} multiPlatform: true - os: windows-2022 platforms: windows/amd64 file: windows.Dockerfile + buildArgs: VERSION=${{ github.event.workflow_run.head_branch }} tags: windows-latest, windows-${{ github.event.workflow_run.head_branch }} multiPlatform: false diff --git a/.github/workflows/test-and-build.yml b/.github/workflows/test-and-build.yml index f0803588..820e12f7 100644 --- a/.github/workflows/test-and-build.yml +++ b/.github/workflows/test-and-build.yml @@ -18,6 +18,9 @@ jobs: steps: - uses: actions/checkout@v4 + with: + # Workaround to get tags, getting git describe to work. + fetch-depth: 0 - name: Install Go uses: actions/setup-go@v5 @@ -38,7 +41,7 @@ jobs: # anymore, but I have had issues with this in the past) :D CGO_ENABLED: 0 run: | - go build -trimpath -ldflags "-w -s -X 'github.com/scribble-rs/scribble.rs/internal/version.Version=$VERSION'" -o ${{ matrix.binary_name }} ./cmd/scribblers + go build -trimpath -ldflags "-w -s -X 'github.com/scribble-rs/scribble.rs/internal/version.Version=$(git describe --tags --dirty)'" -o ${{ matrix.binary_name }} ./cmd/scribblers - name: Upload build artifact uses: actions/upload-artifact@v4