Skip to content

v2.0.0-alpha3

v2.0.0-alpha3 #54

Workflow file for this run

name: publish artifacts
on:
release:
types: [ published ]
jobs:
publish-xcframework:
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Get Release
id: get_release
run: |
echo "tag_name=${tag_name}" | tee -a $GITHUB_OUTPUT
dist_branch=$(echo ${target_commitsh} | awk -F / '{print $NF}')
echo "dist_branch=${dist_branch}" | tee -a $GITHUB_OUTPUT
gh_pages_branch="gh-pages$([ "${dist_branch}" != "main" ] && echo "-${dist_branch}")"
echo "gh_pages_branch=${gh_pages_branch}" | tee -a $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ github.token }}
tag_name: ${{ github.event.release.tag_name }}
target_commitsh: ${{ github.event.release.target_commitish }}
- name: Download xcframework
run: |
echo "VERS=${VERS}"
gh release download "${VERS}" -p CZiti.xcframework.zip
env:
VERS: ${{ steps.get_release.outputs.tag_name }}
GITHUB_TOKEN: ${{ github.token }}
- name: Compute Checksum
id: calc_checksum
run: |
# checksum=$(swift package compute-checksum ./CZiti.xcframework.zip)
checksum=$(shasum -a 256 ./CZiti.xcframework.zip | cut -d " " -f1)
echo "checksum=${checksum}" | tee -a $GITHUB_OUTPUT
- name: Checkout Distribution Project
uses: actions/checkout@v4
with:
repository: openziti/ziti-sdk-swift-dist
ref: ${{ steps.get_release.outputs.dist_branch }}
- name: Edit Package.swift
env:
VERS: ${{ steps.get_release.outputs.tag_name }}
CHKSM: ${{ steps.calc_checksum.outputs.checksum }}
run: |
echo "VERS=${VERS}; CHKSM=${CHKSM}"
sed "/let version = \"/s/.*/let version = \"${VERS}\"/; /let checksum = \"/s/.*/let checksum = \"${CHKSM}\"/" Package.swift > Package.swift.next
cat Package.swift.next
mv Package.swift.next Package.swift
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.19.x'
- name: Install Ziti CI
uses: openziti/ziti-ci@v1
- name: Git Commit and Tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
gh_ci_key: ${{ secrets.GH_CI_KEY }}
ziti_ci_gpg_key: ${{ secrets.ZITI_CI_GPG_KEY }}
ziti_ci_gpg_key_id: ${{ secrets.ZITI_CI_GPG_KEY_ID }}
VERS: ${{ steps.get_release.outputs.tag_name }}
CHKSM: ${{ steps.calc_checksum.outputs.checksum }}
run: |
echo ${VERS} > version
$(go env GOPATH)/bin/ziti-ci configure-git
echo "Updating remote to ssh ziti-sdk-swift-dist"
git remote set-url origin git@github.com:openziti/ziti-sdk-swift-dist.git
git commit -m "set version = ${VERS}; set checksum = ${CHKSM}" Package.swift
git push
git tag -a ${VERS} -m "Release v${VERS}"
git push origin ${VERS}
publish-docs:
runs-on: ubuntu-latest
concurrency: ci-${{ github.ref }}
steps:
- name: Checkout Project
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download Docs
run: gh release download -p ziti-sdk-swift-docs.tgz
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Extract Docs
run: |
mkdir ./docs
tar -xvzf ./ziti-sdk-swift-docs.tgz -C ./docs .
- name: Publish Docs
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs
branch: ${{ steps.get_release.outputs.gh_pages_branch }}