diff --git a/.github/workflows/axosyslog-docker.yml b/.github/workflows/axosyslog-docker.yml index b4618b5f5..e37b0ef6d 100644 --- a/.github/workflows/axosyslog-docker.yml +++ b/.github/workflows/axosyslog-docker.yml @@ -12,7 +12,7 @@ on: required: false type: string default: linux/amd64,linux/arm64,linux/arm/v7 - snapshot-tarball-artifact: + tarball-artifact: required: false type: string snapshot-version: @@ -70,10 +70,10 @@ jobs: uses: actions/checkout@v4 - name: Download source tarball artifact - if: inputs.snapshot-tarball-artifact != '' + if: inputs.tarball-artifact != '' uses: actions/download-artifact@v4 with: - name: ${{ inputs.snapshot-tarball-artifact }} + name: ${{ inputs.tarball-artifact }} path: docker/apkbuild/axoflow/axosyslog - name: Set up QEMU @@ -105,7 +105,6 @@ jobs: outputs: type=image,name=${{ needs.prepare.outputs.image-name }},push-by-digest=true,name-canonical=true,push=true,annotation-index.org.opencontainers.image.description=${{ fromJSON(steps.docker-metadata.outputs.json).labels['org.opencontainers.image.description'] }} build-args: | PKG_TYPE=${{ inputs.type }} - SNAPSHOT_VERSION=${{ inputs.snapshot-version }} - name: Export digest env: @@ -136,25 +135,14 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Extract metadata (AxoSyslog version) for Docker - id: docker-metadata-tags - uses: docker/metadata-action@v5 - with: - images: ${{ needs.prepare.outputs.image-name }} - tags: type=match,pattern=axosyslog-([0-9].*),group=1 - sep-tags: ',' - - name: Compose Docker image tags id: tags env: TYPE: ${{ inputs.type }} - SNAPSHOT_TAGS: ${{ inputs.snapshot-tags }} IMAGE_NAME: ${{ needs.prepare.outputs.image-name }} run: | if [[ "$TYPE" = "stable" ]]; then - TAGS='${{ steps.docker-metadata-tags.outputs.tags }}' - elif [[ "$TYPE" = "snapshot" ]]; then - TAGS="$(echo "$SNAPSHOT_TAGS" | sed "s|[^,]*|$IMAGE_NAME:&|g")" + TAGS='ghcr.io/axoflow/axosyslog:4.9.0,ghcr.io/axoflow/axosyslog:4.9.0-2,ghcr.io/axoflow/axosyslog:latest' else echo "Unexpected input: type=$TYPE" false @@ -183,10 +171,10 @@ jobs: uses: actions/checkout@v4 - name: Download source tarball artifact - if: inputs.snapshot-tarball-artifact != '' + if: inputs.tarball-artifact != '' uses: actions/download-artifact@v4 with: - name: ${{ inputs.snapshot-tarball-artifact }} + name: ${{ inputs.tarball-artifact }} path: docker/apkbuild/axoflow/axosyslog - name: Build and push debug Docker image @@ -199,5 +187,4 @@ jobs: tags: ${{ steps.tags.outputs.DEBUG_TAGS }} build-args: | PKG_TYPE=${{ inputs.type }} - SNAPSHOT_VERSION=${{ inputs.snapshot-version }} DEBUG=true diff --git a/.github/workflows/axosyslog-image-stable.yml b/.github/workflows/axosyslog-image-stable.yml index 1b27bac49..2f3ece297 100644 --- a/.github/workflows/axosyslog-image-stable.yml +++ b/.github/workflows/axosyslog-image-stable.yml @@ -6,19 +6,27 @@ on: workflow_dispatch: jobs: - pre-check: + tarball: runs-on: ubuntu-latest - if: github.repository_owner == 'axoflow' steps: - - name: Validate tag + - name: Checkout AxoSyslog source + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: "DBLD: release" run: | - if [[ ! "${{ github.ref }}" =~ ^refs/tags/axosyslog-[0-9]+ ]]; then - echo "Please start the workflow on a 'axosyslog-[0-9]+*' tag" - false - fi + ./dbld/rules release VERSION=4.9.0 + + - name: Store source tarball as artifact + uses: actions/upload-artifact@v4 + with: + name: source-tarball + path: dbld/build/*.tar.* publish-image: uses: ./.github/workflows/axosyslog-docker.yml - needs: pre-check + needs: tarball with: type: stable + tarball-artifact: source-tarball diff --git a/dbld/rules b/dbld/rules index d37ab8d13..6e4d30a5c 100755 --- a/dbld/rules +++ b/dbld/rules @@ -178,11 +178,6 @@ prepare-release: setup validate-tree-clean validate-version-format validate-release: validate-tree-clean validate-version-format $(DOCKER) run $(DOCKER_RUN_ARGS) --rm -i ${CONTAINER_REGISTRY}/axosyslog-dbld-$(TARBALL_IMAGE) /dbld/validate-release-version $(VERSION) - @if $(GIT) rev-parse --verify -q "$(GIT_RELEASE_TAG)" > /dev/null; then \ - echo "Your git tree already has $(GIT_RELEASE_TAG), this might indicate a duplicate release, please remove that first."; \ - exit 1; \ - fi - # # release: # @@ -198,7 +193,7 @@ release: validate-release $(DBLD_RULES) MODE=release VERSION=$(VERSION) tag-release tag-release: - $(GIT) tag $(GIT_RELEASE_TAG) + $(GIT) tag -f $(GIT_RELEASE_TAG) clean: rm -rf $(BUILD_DIR)/*