Skip to content

Commit

Permalink
More workflow fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stoyicker committed Apr 13, 2024
1 parent 2b9f2d4 commit 982d10f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ on:
push:
tags:
- '**'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
create-github-release:
runs-on: ubuntu-22.04
Expand All @@ -13,19 +11,21 @@ jobs:
- 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: [ create-github-release ]
permissions:
packages: write
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/runGradleTask
with:
preTaskString: -Pversion=$GITHUB_REF_NAME
task: library:publishKotlinMultiplatformPublicationToGithubPackagesRepository
- uses: actions/[email protected]
with:
name: upload_url
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
attach-xcframework-to-github-release:
runs-on: macos-14-xlarge
needs: [ create-github-release ]
Expand All @@ -38,12 +38,14 @@ jobs:
- uses: actions/[email protected]
with:
name: upload_url
- run: echo $UPLOAD_URL
- run: UPLOAD_URL=$(cat upload_url | sed "s/{?name,label}/?name=Library-${GITHUB_REF_NAME}.xcframework.zip/")
- run: echo $UPLOAD_URL
- run: |
curl -s \
-u ${GITHUB_ACTOR}:${GITHUB_TOKEN} \
--header "Accept: application/vnd.github.v3+json" \
--header "Content-Type: application/zip" \
--data-binary "@Library.xcframework.zip" \
--request POST \
$UPLOAD_URL
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
--data-binary "@Library.xcframework.zip" \
$UPLOAD_URL
10 changes: 5 additions & 5 deletions .scripts/github/release.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -ev
set -e

BODY="{
\"tag_name\": \"${GITHUB_REF_NAME}\",
Expand All @@ -8,10 +8,10 @@ BODY="{
\"body\": \"$(cat "$GITHUB_WORKSPACE"/changelog/"$GITHUB_REF_NAME")\"
}"

RESPONSE_BODY=$(curl -s \
-u "${GITHUB_ACTOR}":"${GITHUB_TOKEN}" \
--header "Accept: application/vnd.github.v3+json" \
--header "Content-Type: application/json; charset=utf-8" \
RESPONSE_BODY=$(curl -sL \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
--request POST \
--data "${BODY}" \
https://api.github.com/repos/"${GITHUB_REPOSITORY}"/releases)
Expand Down

0 comments on commit 982d10f

Please sign in to comment.