From 647f7fc002f5e8d5fe99b62ee519783aff51d9ca Mon Sep 17 00:00:00 2001 From: Martin Kysel Date: Fri, 20 Dec 2024 09:52:59 -0500 Subject: [PATCH 1/3] Proper version names --- .github/workflows/build-pre-baked-images.yml | 2 +- .github/workflows/build-xmtpd.yml | 4 +++- .github/workflows/release-from-tag.yml | 2 +- dev/run | 2 +- dev/run-2 | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-pre-baked-images.yml b/.github/workflows/build-pre-baked-images.yml index 72e2776d..17ceb79c 100644 --- a/.github/workflows/build-pre-baked-images.yml +++ b/.github/workflows/build-pre-baked-images.yml @@ -9,7 +9,7 @@ on: jobs: push_to_registry: - name: Push Docker Image to GitHub Packages + name: Build pre-baked anvil-xmtpd runs-on: ubuntu-latest permissions: contents: read diff --git a/.github/workflows/build-xmtpd.yml b/.github/workflows/build-xmtpd.yml index 2ff5e4ad..682f05a7 100644 --- a/.github/workflows/build-xmtpd.yml +++ b/.github/workflows/build-xmtpd.yml @@ -53,6 +53,8 @@ jobs: echo "Unknown image: ${{ matrix.image }}" exit 1 fi + - uses: benjlevesque/short-sha@v3.0 + id: short-sha - name: Build and push Docker image uses: docker/build-push-action@v6 id: push @@ -62,7 +64,7 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - build-args: "GIT_COMMIT=${{ github.event_name != 'pull_request' && github.sha || github.event.pull_request.head.sha }}" + build-args: "GIT_COMMIT=dev-${{ steps.short-sha.outputs.sha }}" - name: Set xmtpd digest output if: ${{ matrix.image == 'xmtpd' }} diff --git a/.github/workflows/release-from-tag.yml b/.github/workflows/release-from-tag.yml index cdc17526..2a7be429 100644 --- a/.github/workflows/release-from-tag.yml +++ b/.github/workflows/release-from-tag.yml @@ -55,4 +55,4 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - build-args: "GIT_COMMIT=${{ github.event_name != 'pull_request' && github.sha || github.event.pull_request.head.sha }}" \ No newline at end of file + build-args: "GIT_COMMIT=${{ github.ref_name }}-${{ github.event_name != 'pull_request' && github.sha || github.event.pull_request.head.sha }}" \ No newline at end of file diff --git a/dev/run b/dev/run index a9bd9279..22c2fff3 100755 --- a/dev/run +++ b/dev/run @@ -8,4 +8,4 @@ export XMTPD_PAYER_ENABLE=true export XMTPD_REPLICATION_ENABLE=true export XMTPD_SYNC_ENABLE=true -go run -ldflags="-X main.Commit=$(git rev-parse HEAD)" cmd/replication/main.go "$@" \ No newline at end of file +go run -ldflags="-X main.Commit=dev-$(git rev-parse --short HEAD)" cmd/replication/main.go "$@" \ No newline at end of file diff --git a/dev/run-2 b/dev/run-2 index a2ea4e23..60011fbe 100755 --- a/dev/run-2 +++ b/dev/run-2 @@ -12,4 +12,4 @@ export XMTPD_PAYER_ENABLE=true export XMTPD_REPLICATION_ENABLE=true export XMTPD_SYNC_ENABLE=true -go run -ldflags="-X main.Commit=$(git rev-parse HEAD)" cmd/replication/main.go -p 5051 "$@" \ No newline at end of file +go run -ldflags="-X main.Commit=dev-$(git rev-parse --short HEAD)" cmd/replication/main.go -p 5051 "$@" \ No newline at end of file From 7d15f6078a361f80fdc5f94ccf87f82c9e7f9695 Mon Sep 17 00:00:00 2001 From: Martin Kysel Date: Fri, 20 Dec 2024 09:55:26 -0500 Subject: [PATCH 2/3] no shortening --- .github/workflows/build-xmtpd.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build-xmtpd.yml b/.github/workflows/build-xmtpd.yml index 682f05a7..acaf1b1c 100644 --- a/.github/workflows/build-xmtpd.yml +++ b/.github/workflows/build-xmtpd.yml @@ -53,8 +53,6 @@ jobs: echo "Unknown image: ${{ matrix.image }}" exit 1 fi - - uses: benjlevesque/short-sha@v3.0 - id: short-sha - name: Build and push Docker image uses: docker/build-push-action@v6 id: push @@ -64,7 +62,7 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - build-args: "GIT_COMMIT=dev-${{ steps.short-sha.outputs.sha }}" + build-args: "GIT_COMMIT=dev-${{ github.event_name != 'pull_request' && github.sha || github.event.pull_request.head.sha }}" - name: Set xmtpd digest output if: ${{ matrix.image == 'xmtpd' }} From 564bdc9064b152cb8029c07e7d6f9cad40af2fe1 Mon Sep 17 00:00:00 2001 From: Martin Kysel Date: Fri, 20 Dec 2024 10:04:02 -0500 Subject: [PATCH 3/3] make consistent --- dev/run | 2 +- dev/run-2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/run b/dev/run index 22c2fff3..fd3ded4c 100755 --- a/dev/run +++ b/dev/run @@ -8,4 +8,4 @@ export XMTPD_PAYER_ENABLE=true export XMTPD_REPLICATION_ENABLE=true export XMTPD_SYNC_ENABLE=true -go run -ldflags="-X main.Commit=dev-$(git rev-parse --short HEAD)" cmd/replication/main.go "$@" \ No newline at end of file +go run -ldflags="-X main.Commit=dev-$(git rev-parse HEAD)" cmd/replication/main.go "$@" \ No newline at end of file diff --git a/dev/run-2 b/dev/run-2 index 60011fbe..2c6a0ed2 100755 --- a/dev/run-2 +++ b/dev/run-2 @@ -12,4 +12,4 @@ export XMTPD_PAYER_ENABLE=true export XMTPD_REPLICATION_ENABLE=true export XMTPD_SYNC_ENABLE=true -go run -ldflags="-X main.Commit=dev-$(git rev-parse --short HEAD)" cmd/replication/main.go -p 5051 "$@" \ No newline at end of file +go run -ldflags="-X main.Commit=dev-$(git rev-parse HEAD)" cmd/replication/main.go -p 5051 "$@" \ No newline at end of file