-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (60 loc) · 1.92 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
name: Publish
on:
push:
tags:
- '**'
permissions:
contents: write
packages: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
ensure-tag-is-on-main:
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
with:
ref: main
fetch-depth: 0
- run: exit $(git merge-base --is-ancestor $tag HEAD)
create-github-release:
runs-on: ubuntu-22.04
needs: [ ensure-tag-is-on-main ]
steps:
- uses: actions/[email protected]
- run: .scripts/github/release.sh > upload_url
- uses: actions/[email protected]
with:
name: upload_url
path: upload_url
jvm-maven-github:
runs-on: macos-14-xlarge
needs: [ ensure-tag-is-on-main ]
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/runGradleTask
with:
preTaskString: -Pversion=$GITHUB_REF_NAME
task: library:publishKotlinMultiplatformPublicationToGithubPackagesRepository
attach-xcframework-to-github-release:
runs-on: macos-14-xlarge
needs: [ create-github-release ]
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/runGradleTask
with:
task: :library:assembleLibraryReleaseXCFramework
- run: zip -r Library.xcframework.zip library/build/XCFrameworks/release/library.xcframework
- uses: actions/[email protected]
with:
name: upload_url
- run: echo UPLOAD_URL=$(cat upload_url | sed "s/{?name,label}/?name=Library-${GITHUB_REF_NAME}.xcframework.zip/") >> $GITHUB_ENV
- run: |
curl -s \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-H "Content-Type: application/octet-stream" \
--data-binary "@Library.xcframework.zip" \
$UPLOAD_URL