action: support client_payload

This commit is contained in:
Evans Mike 2023-11-21 12:44:17 +00:00
parent 045af45c56
commit 5eeb17a9fb

View file

@ -17,12 +17,17 @@ jobs:
buildType: [full]
distro: [alpine]
runs-on: ubuntu-latest
env:
TAG: ${{ github.event.client_payload.tag || github.event.inputs.tag}}
steps:
- name: Get Build Tags
run: |
echo "Version: ${{env.TAG}}"
- name: Checkout Source Code of 'SagerNet/sing-box'
uses: actions/checkout@v3
with:
repository: 'SagerNet/sing-box'
ref: ${{ github.event.inputs.tag }}
ref: ${{env.TAG}}
submodules: true
- name: Checkout Action Repo
uses: actions/checkout@v3
@ -78,13 +83,13 @@ jobs:
if [[ "${{ matrix.distro }}" == "distroless" && "${{ matrix.buildType }}" == "full" ]]; then
echo "latest=etnperlong/sing-box:distroless" >> $GITHUB_OUTPUT
fi
if [[ -z "${{ github.event.inputs.tag }}" ]]; then
if [[ -z "${{env.TAG}}" ]]; then
echo "versioned=etnperlong/sing-box:${{ github.ref_name }}" >> $GITHUB_OUTPUT
else
if [[ -n "${{ steps.dockerfile.outputs.tagpost }}" ]]; then
echo "versioned=etnperlong/sing-box:${{ github.event.inputs.tag }}-${{ steps.dockerfile.outputs.tagpost }}" >> $GITHUB_OUTPUT
echo "versioned=etnperlong/sing-box:${{env.TAG}}-${{ steps.dockerfile.outputs.tagpost }}" >> $GITHUB_OUTPUT
else
echo "versioned=etnperlong/sing-box:${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
echo "versioned=etnperlong/sing-box:${{env.TAG}}" >> $GITHUB_OUTPUT
fi
fi
- name: Build and release Docker images