Skip to content

feat: extract binary actions: temporary upload to artifact #9

feat: extract binary actions: temporary upload to artifact

feat: extract binary actions: temporary upload to artifact #9

Workflow file for this run

name: Extract executable binary and upload artifacts
on:
push:
# workflow_run:
# workflows:
# - "Build and Publish Docker"
# - "Unit Test"
# types:
# - "completed"
# branches:
# - "main"
# - "develop"
jobs:
on-success:
runs-on: ubuntu-latest
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
matrix:
include:
- target: "gnu"
platform: linux/amd64
- target: "gnu"
platform: linux/arm64
- target: "musl"
platform: linux/amd64
tags-suffix: "-slim"
- target: "musl"
platform: linux/arm64
tags-suffix: "-slim"
- target: "gnu-s2n"
platform: linux/amd64
tags-suffix: "-s2n"
- target: "gnu-s2n"
platform: linux/arm64
tags-suffix: "-s2n"
steps:
- run: "echo 'The relese triggering workflows passed'"
- name: "set env"
#if [ ${{ github.ref_name == 'develop' }} ];then BUILD_NAME="-nightly";else BUILD_NAME="";fi
run: |
if [ ${{ matrix.platform }} = "linux/amd64" ];then PLATFORM_MAP="x86_64";else PLATFORM_MAP="aarch64";fi
echo "PLATFORM_MAP=${PLATFORM_MAP}" >> $GITHUB_ENV
echo "TARGET_NAME=rpxy-nightly-${PLATFORM_MAP}-unknown-linux-${{ matrix.target }}" >> $GITHUB_ENV
- name: "docker pull and extract binary from docker image"
id: "extract-binary"
run: |
CONTAINER_ID=`docker create --platform=${{ matrix.platform }} ghcr.io/junkurihara/rust-rpxy:nightly${{ matrix.tags-suffix }}`
docker cp ${CONTAINER_ID}:/rpxy/bin/rpxy /tmp/${TARGET_NAME}
cd /tmp
tar zcvf ${TARGET_NAME}.tar.gz ${TARGET_NAME}
echo "artifact=${TARGET_NAME}" >> $GITHUB_OUTPUT
- name: "upload artifacts"
uses: actions/upload-artifact@v3
with:
name: ${{ steps.extract-binary.outputs.artifact }}
path: "/tmp/${{ steps.extract-binary.outputs.artifact }}.tar.gz"
# on-failure:
# runs-on: ubuntu-latest
# if: ${{ github.event.workflow_run.conclusion == 'failure' }}
# steps:
# - run: echo 'The release triggering workflows failed'