Skip to content

Commit

Permalink
rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAnno committed Nov 23, 2024
1 parent 389566a commit eb938a2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 33 deletions.
25 changes: 6 additions & 19 deletions .github/workflows/axosyslog-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -199,5 +187,4 @@ jobs:
tags: ${{ steps.tags.outputs.DEBUG_TAGS }}
build-args: |
PKG_TYPE=${{ inputs.type }}
SNAPSHOT_VERSION=${{ inputs.snapshot-version }}
DEBUG=true
24 changes: 16 additions & 8 deletions .github/workflows/axosyslog-image-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 1 addition & 6 deletions dbld/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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:
#
Expand All @@ -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)/*
Expand Down

0 comments on commit eb938a2

Please sign in to comment.