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