Build and Publish Release Artifacts #216
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build release artifacts | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
call-cmake-build: | |
uses: ./.github/workflows/cmake.yml | |
release: | |
name: Download Release Artifacts | |
runs-on: ubuntu-latest | |
needs: [ call-cmake-build ] | |
outputs: | |
ZITI_VERSION: ${{ steps.get_version.outputs.ZITI_VERSION }} | |
steps: | |
- name: Debug action | |
uses: hmarr/debug-action@v3 | |
- name: download | |
uses: actions/download-artifact@v4 | |
with: | |
path: ${{ runner.workspace }}/downloads | |
merge_multiple: false # some artifacts have the same name and so can not be aggregated in a single directory | |
# This step is only necessary because we prefer a different release artifact name | |
# than is created by CMake, and so we could change the CMake configuration but for | |
# now this is easier. The pre-release build doesn't rename the artifacts. | |
- name: Rename bundle assets | |
working-directory: ${{ runner.workspace }}/downloads/ | |
shell: bash | |
run: | | |
pwd | |
mv linux-arm64/ziti-edge-tunnel-Linux_aarch64.zip linux-arm64/ziti-edge-tunnel-Linux_arm64.zip | |
mv windows-x64-mingw/ziti-edge-tunnel-Windows_AMD64.zip windows-x64-mingw/ziti-edge-tunnel-Windows_x86_64.zip | |
mv linux-arm-static/ziti-edge-tunnel-Linux_arm.zip linux-arm-static/ziti-edge-tunnel-Linux_arm-static.zip | |
mv linux-arm64-static/ziti-edge-tunnel-Linux_aarch64.zip linux-arm64-static/ziti-edge-tunnel-Linux_arm64-static.zip | |
mv linux-x64-static/ziti-edge-tunnel-Linux_x86_64.zip linux-arm64-static/ziti-edge-tunnel-Linux_x86_64-static.zip | |
- name: List Release Artifacts | |
run: ls -horRAS ${{runner.workspace}}/downloads/ | |
# the purpose of this step is to identify the release that was created for the current tag and upload the | |
# artifacts that do not need to be renamed | |
- name: Release | |
id: get_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
# name: defaults to tag name | |
# tag_name: defaults to github.ref | |
# token: defaults to github.token | |
fail_on_unmatched_files: true | |
files: | | |
${{ runner.workspace }}/downloads/**/*.zip | |
- name: Get the Version String from Git Tag | |
id: get_version | |
env: | |
RELEASE_REF: ${{ github.ref_name }} | |
run: | | |
ZITI_VERSION="${RELEASE_REF#v}" | |
if [[ "${ZITI_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
echo ZITI_VERSION="${ZITI_VERSION}" | tee -a $GITHUB_OUTPUT | |
else | |
# fail the job because we could not obtain a valid version string from the Git ref | |
echo "ERROR: ZITI_VERSION=${ZITI_VERSION} is not a release semver" | |
exit 1 | |
fi | |
call-publish-container-images: | |
name: Publish Container Images | |
needs: [ release ] | |
uses: ./.github/workflows/publish-container-images.yml | |
secrets: inherit | |
with: | |
ziti-version: ${{ needs.release.outputs.ZITI_VERSION }} |