Merge pull request #154 from avianlabs/guillermo/dont-serialize-unpar… #18
Workflow file for this run
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
name: 'Release Swift package' | |
on: | |
push: | |
tags: | |
- '*' | |
workflow_dispatch: | |
inputs: | |
tagname: | |
type: string | |
required: true | |
description: tag to run the release on | |
permissions: | |
pull-requests: write | |
deployments: write | |
checks: write | |
statuses: write | |
contents: write | |
jobs: | |
build: | |
name: Build Project | |
runs-on: macos-14 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Setup Xcode | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: '15.3' | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: '18' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Cache konan | |
uses: actions/cache@v4 | |
with: | |
path: ~/.konan | |
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
restore-keys: ${{ runner.os }}-konan- | |
- name: Create Swift package | |
run: ./gradlew -Psnapshot=false :solana-kotlin:createSwiftPackage | |
- name: Upload artifact to release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ github.event.inputs.tagname || github.ref_name }} | |
files: | | |
solana-kotlin/swiftpackage/SolanaKotlin.zip | |
- name: Checkout package branch | |
uses: actions/checkout@v4 | |
with: | |
path: _otherBranch | |
ref: swiftpackage | |
- name: Copy Package.swift | |
run: cp solana-kotlin/swiftpackage/Package.swift _otherBranch/Package.swift | |
- name: Commit and push changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
cwd: './_otherBranch' | |
fetch: false | |
tag: '${{ github.event.inputs.tagname || github.ref_name }}-swiftpackage' | |
- name: Bundle the failed build report | |
if: failure() | |
run: find ./build -type d -name 'reports' | zip -@ -r build-reports.zip | |
- name: Upload the failed build report | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: error-report | |
path: build-reports.zip | |
retention-days: 7 |