Skip to content

Build and Publish DEB Package #145

Build and Publish DEB Package

Build and Publish DEB Package #145

Workflow file for this run

name: Build and Publish Package
on:
create
jobs:
publish_apisix:
name: Build and Publish deb Package
runs-on: ubuntu-20.04
timeout-minutes: 60
env:
VAR_DEB_WORKBENCH_DIR: /tmp/output
VAR_OS: debian
VAR_CODENAME: bullseye
VAR_OS_RELEASE: bullseye-slim
steps:
- name: Check out code
uses: actions/[email protected]
with:
submodules: recursive
- name: Init basic publish env
run: |
sudo apt-get update
mkdir -p "${VAR_DEB_WORKBENCH_DIR}"
- name: Extract Tags name
if: ${{ startsWith(github.ref, 'refs/tags/') }}
id: tag_env
shell: bash
run: |
echo "##[set-output name=version;]$(echo ${GITHUB_REF##*/})"
- name: Extract Tags Type
if: ${{ startsWith(github.ref, 'refs/tags/') }}
id: tag_type
shell: bash
run: |
echo "##[set-output name=version;]$(echo ${GITHUB_REF#refs/tags/})"
- name: Build apisix deb Package
if: ${{ startsWith(steps.tag_type.outputs.version, 'apisix/') }}
env:
APISIX_TAG_VERSION: ${{ steps.tag_env.outputs.version}}
run: |
# build apisix
make package type=deb app=apisix openresty=apisix-base checkout=${APISIX_TAG_VERSION} version=${APISIX_TAG_VERSION} image_base=${VAR_OS} image_tag=${VAR_OS_RELEASE}
mv ./output/apisix_${APISIX_TAG_VERSION}-0~${VAR_OS}${VAR_OS_RELEASE}_amd64.deb ${VAR_DEB_WORKBENCH_DIR}
- name: Build apisix-base deb Package
if: ${{ startsWith(steps.tag_type.outputs.version, 'apisix-base/') }}
env:
APISIX_BASE_TAG_VERSION: ${{ steps.tag_env.outputs.version}}
run: |
# build apisix-base
echo ${{ steps.tag_env.outputs.version}}
echo ${{ steps.tag_type.outputs.version}}
make package type=deb app=apisix-base checkout=${APISIX_BASE_TAG_VERSION} version=${APISIX_BASE_TAG_VERSION} image_base=${VAR_OS} image_tag=${VAR_OS_RELEASE}
mv ./output/apisix-base_${APISIX_BASE_TAG_VERSION}-0~${VAR_OS}${VAR_OS_RELEASE}_amd64.deb ${VAR_DEB_WORKBENCH_DIR}
- name: Upload apisix Artifact
if: ${{ startsWith(steps.tag_type.outputs.version, 'apisix/') }}
uses: actions/[email protected]
with:
name: "apisix_${{ steps.tag_env.outputs.version}}-0~${{ env.VAR_OS }}${{ env.VAR_OS_RELEASE }}_amd64.deb"
path: "${{ env.VAR_DEB_WORKBENCH_DIR }}/apisix_${{ steps.tag_env.outputs.version}}-0~${{ env.VAR_OS }}${{ env.VAR_OS_RELEASE }}_amd64.deb"
- name: Upload apisix-base Artifact
if: ${{ startsWith(steps.tag_type.outputs.version, 'apisix-base/') }}
uses: actions/[email protected]
with:
name: "apisix-base_${{ steps.tag_env.outputs.version}}-0~${{ env.VAR_OS }}${{ env.VAR_OS_RELEASE }}_amd64.deb"
path: "${{ env.VAR_DEB_WORKBENCH_DIR }}/apisix-base_${{ steps.tag_env.outputs.version}}-0~${{ env.VAR_OS }}${{ env.VAR_OS_RELEASE }}_amd64.deb"