-
Notifications
You must be signed in to change notification settings - Fork 3
97 lines (83 loc) · 2.87 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: publish artifacts
on:
release:
types: [ published ]
jobs:
publish-xcframework:
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v3
- name: Get Release
id: get_release
run: |
tag_name=$(gh release view --json tagName --jq .tagName)
echo "tag_name=${tag_name}" | tee -a $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Download xcframework
run: gh release download -p CZiti.xcframework.zip
env:
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@v3
with:
repository: openziti/ziti-sdk-swift-dist
- 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@v3
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 [email protected]: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@v3
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