Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/release-apisix-runtime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Release apisix-runtime

on:
release:
types:
- published
workflow_dispatch:
inputs:
version:
description: "apisix-runtime version to release"
required: true

permissions:
contents: write

jobs:
release:
name: Release
if: github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, 'apisix-runtime/')
timeout-minutes: 90
env:
RELEASE_TAG: ${{ github.event_name == 'release' && github.event.release.tag_name || format('apisix-runtime/{0}', github.event.inputs.version) }}
strategy:
fail-fast: false
matrix:
platform:
- runner: ubuntu-24.04
arch: amd64
build_arch: linux/amd64
- runner: ubuntu-24.04-arm
arch: arm64
build_arch: linux/arm64/v8
runs-on: ${{ matrix.platform.runner }}
steps:
- name: Resolve release version
run: |
version="${RELEASE_TAG#apisix-runtime/}"
if [[ "$version" == "$RELEASE_TAG" || ! "$version" =~ ^[0-9A-Za-z._-]+$ ]]; then
echo "invalid release tag: $RELEASE_TAG" >&2
exit 1
fi
echo "VERSION=$version" >> "$GITHUB_ENV"

- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
ref: ${{ env.RELEASE_TAG }}

Comment thread
coderabbitai[bot] marked this conversation as resolved.
Comment thread
jarvis9443 marked this conversation as resolved.
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y make ruby ruby-dev rubygems build-essential

- name: Build apisix-runtime deb
run: |
make package type=deb app=apisix-runtime runtime_version="${VERSION}" image_base=debian image_tag=bookworm-slim arch=${{ matrix.platform.build_arch }}

- name: Build apisix-runtime-debug deb
run: |
make package type=deb app=apisix-runtime runtime_version="${VERSION}" image_base=debian image_tag=bookworm-slim arch=${{ matrix.platform.build_arch }} build_latest=latest artifact=apisix-runtime-debug

- name: Upload release assets
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release view "$RELEASE_TAG" >/dev/null
gh release upload "$RELEASE_TAG" \
"./output/apisix-runtime_${VERSION}-0~debianbookworm-slim_${{ matrix.platform.arch }}.deb" \
"./output/apisix-runtime-debug_${VERSION}-0~debianbookworm-slim_${{ matrix.platform.arch }}.deb" \
--clobber
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ local_code_path=0
openresty="apisix-runtime"
artifact="0"
runtime_version=0
build_latest=
apisix_repo="https://github.com/apache/apisix"
apisix_runtime_repo="https://github.com/api7/apisix-build-tools.git"
dashboard_repo="https://github.com/apache/apisix-dashboard"
Expand Down Expand Up @@ -99,6 +100,7 @@ define build_runtime
--build-arg RUNTIME_VERSION=$(runtime_version) \
--build-arg IMAGE_BASE=$(image_base) \
--build-arg IMAGE_TAG=$(image_tag) \
--build-arg BUILD_LATEST=$(build_latest) \
--build-arg CODE_PATH=$(4) \
Comment thread
jarvis9443 marked this conversation as resolved.
--platform $(arch) \
-f ./dockerfiles/Dockerfile.$(2).$(3) .
Expand All @@ -111,6 +113,7 @@ define build_runtime
--build-arg RUNTIME_VERSION=$(runtime_version) \
--build-arg IMAGE_BASE=$(image_base) \
--build-arg IMAGE_TAG=$(image_tag) \
--build-arg BUILD_LATEST=$(build_latest) \
--build-arg CODE_PATH=$(4) \
--load \
--cache-from=$(cache_from) \
Expand Down
2 changes: 1 addition & 1 deletion package-apisix-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ fi

if [ "$PACKAGE_TYPE" == "deb" ]; then
# Rename deb file with adding $DIST section
mv /output/apisix-runtime_"${RUNTIME_VERSION}"-"${ITERATION}"_"${PACKAGE_ARCH}".deb /output/apisix-runtime_"${RUNTIME_VERSION}"-"${ITERATION}"~"${dist}"_"${PACKAGE_ARCH}".deb
mv /output/"${artifact}"_"${RUNTIME_VERSION}"-"${ITERATION}"_"${PACKAGE_ARCH}".deb /output/"${artifact}"_"${RUNTIME_VERSION}"-"${ITERATION}"~"${dist}"_"${PACKAGE_ARCH}".deb
fi
Loading