-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
121 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
name: Promote Downstream Releases | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
# cancel older, redundant runs of same workflow on same branch | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
parse_version: | ||
name: Parse Release Version | ||
runs-on: ubuntu-latest | ||
env: | ||
RELEASE_REF: ${{ github.ref}} | ||
outputs: | ||
version: ${{ steps.parse.outputs.version }} | ||
steps: | ||
- name: Parse Release Version | ||
id: parse | ||
shell: bash | ||
run: | | ||
if [[ "${RELEASE_REF}" =~ ^refs\/tags\/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
echo "RELEASE_REF=${RELEASE_REF} is a semver release ref" | ||
echo "version=${RELEASE_REF#refs/tags/v}" | tee -a $GITHUB_OUTPUT | ||
else | ||
echo "RELEASE_REF=${RELEASE_REF} is not a semver release ref" >&2 | ||
exit 1 | ||
fi | ||
set_matrix: | ||
name: Set CPack Config Matrix | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set_matrix.outputs.matrix }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set Matrix | ||
id: set_matrix | ||
shell: bash | ||
run: | | ||
matrix="$( | ||
yq --output-format json .github/cpack-matrix.yml \ | ||
| jq --compact-output '.cpack_matrix' | ||
)" | ||
echo "matrix=$matrix" | tee -a $GITHUB_OUTPUT | ||
promote_docker: | ||
needs: parse_version | ||
name: Promote Docker Hub to Latest | ||
runs-on: ubuntu-latest | ||
env: | ||
ZITI_EDGE_TUNNEL_IMAGE: ${{ vars.ZITI_EDGE_TUNNEL_IMAGE || 'docker.io/openziti/ziti-edge-tunnel' }} | ||
ZITI_HOST_IMAGE: ${{ vars.ZITI_HOST_IMAGE || 'docker.io/openziti/ziti-host' }} | ||
steps: | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ vars.DOCKER_HUB_API_USER || secrets.DOCKER_HUB_API_USER }} | ||
password: ${{ secrets.DOCKER_HUB_API_TOKEN }} | ||
|
||
- name: Tag Latest zti-edge-tunnel | ||
shell: bash | ||
run: > | ||
docker buildx imagetools create --tag | ||
${{ env.ZITI_EDGE_TUNNEL_IMAGE }}:latest | ||
${{ env.ZITI_EDGE_TUNNEL_IMAGE }}:${{ needs.parse_version.outputs.version }} | ||
- name: Tag Latest zti-host | ||
shell: bash | ||
run: > | ||
docker buildx imagetools create --tag | ||
${{ env.ZITI_HOST_IMAGE }}:latest | ||
${{ env.ZITI_HOST_IMAGE }}:${{ needs.parse_version.outputs.version }} | ||
promote_artifactory: | ||
needs: | ||
- set_matrix | ||
- parse_version | ||
name: Promote Artifactory Testing to Release | ||
runs-on: ubuntu-latest | ||
env: | ||
ZITI_DEB_TEST_REPO: ${{ vars.ZITI_DEB_TEST_REPO || 'zitipax-openziti-deb-test' }} | ||
ZITI_RPM_TEST_REPO: ${{ vars.ZITI_RPM_TEST_REPO || 'zitipax-openziti-rpm-test' }} | ||
ZITI_DEB_PROD_REPO: ${{ vars.ZITI_DEB_PROD_REPO || 'zitipax-openziti-deb-stable' }} | ||
ZITI_RPM_PROD_REPO: ${{ vars.ZITI_RPM_PROD_REPO || 'zitipax-openziti-rpm-stable' }} | ||
strategy: | ||
fail-fast: true | ||
matrix: ${{ fromJSON(needs.set_matrix.outputs.matrix) }} | ||
steps: | ||
- name: Debug action | ||
uses: hmarr/[email protected] | ||
|
||
- name: Configure jFrog CLI | ||
uses: jfrog/setup-jfrog-cli@v3 | ||
env: | ||
JF_ENV_1: ${{ secrets.ZITI_ARTIFACTORY_CLI_CONFIG_PACKAGE_UPLOAD }} | ||
|
||
- name: Copy RPM from testing to release Artifactory repo with jFrog CLI | ||
if: matrix.distro.type == 'rpm' | ||
shell: bash | ||
run: > | ||
jf rt copy | ||
--recursive=false | ||
--flat=true | ||
${{ env.ZITI_RPM_TEST_REPO }}/testing/ziti-edge-tunnel/redhat${{ matrix.distro.version }}/${{ matrix.arch.rpm }}/ziti-edge-tunnel-${{ needs.parse_version.outputs.version }}-*.${{ matrix.arch.rpm }}.rpm" | ||
${{ env.ZITI_RPM_PROD_REPO }}/redhat${{ matrix.distro.version }}/${{ matrix.arch.rpm }}/ | ||
- name: Copy DEB from testing to release Artifactory repo with jFrog CLI | ||
if: matrix.distro.type == 'deb' | ||
shell: bash | ||
run: > | ||
jf rt copy | ||
--recursive=false | ||
--flat=true | ||
${{ env.ZITI_DEB_TEST_REPO }}/pool/testing/ziti-edge-tunnel/${{ matrix.distro.release_name }}/${{ matrix.arch.deb }}/ziti-edge-tunnel-${{ needs.parse_version.outputs.version }}-*.deb | ||
${{ env.ZITI_DEB_PROD_REPO }}/pool/ziti-edge-tunnel/${{ matrix.distro.release_name }}/${{ matrix.arch.deb }}/ |