fix: add shim for IntelliJCoroutines #20
This file contains hidden or 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: Build Kotlin Patched Artifact | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| workflow_dispatch: {} | |
| concurrency: | |
| group: kotlin-build-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Cache Gradle wrapper + caches | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| kotlin-src/.gradle | |
| key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| gradle-${{ runner.os }}- | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y git curl unzip | |
| - name: Get Kotlin source | |
| run: | | |
| ./get_source.sh | |
| - name: Apply patches | |
| run: | | |
| ./patch.sh | |
| - name: Build JAR | |
| run: | | |
| ./build.sh | |
| - name: Compute metadata | |
| id: meta | |
| run: | | |
| JAR=$(ls out/*.jar | head -n1) | |
| echo "jar=$JAR" >> $GITHUB_OUTPUT | |
| NAME=$(basename "$JAR") | |
| echo "name=$NAME" >> $GITHUB_OUTPUT | |
| SHA256=$(sha256sum "$JAR" | awk '{print $1}') | |
| echo "sha256=$SHA256" >> $GITHUB_OUTPUT | |
| VERSION=$(echo "$NAME" | sed -E 's/.*-([0-9]+\.[0-9]+\.[0-9]+)-SNAPSHOT.*/\1/') | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| SHORT_SHA=$(git rev-parse --short HEAD) | |
| echo "short_sha=$SHORT_SHA" >> $GITHUB_OUTPUT | |
| echo "tag=v${VERSION}-${SHORT_SHA}" >> $GITHUB_OUTPUT | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: kotlin-jar | |
| path: ${{ steps.meta.outputs.jar }} | |
| outputs: | |
| tag: ${{ steps.meta.outputs.tag }} | |
| version: ${{ steps.meta.outputs.version }} | |
| short_sha: ${{ steps.meta.outputs.short_sha }} | |
| name: ${{ steps.meta.outputs.name }} | |
| sha256: ${{ steps.meta.outputs.sha256 }} | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: kotlin-jar | |
| path: outputs | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.build.outputs.tag }} | |
| name: Kotlin ${{ needs.build.outputs.version }} (patched) | |
| body: | | |
| Kotlin Version: ${{ needs.build.outputs.version }} | |
| Commit: ${{ needs.build.outputs.short_sha }} | |
| Artifact: ${{ needs.build.outputs.name }} | |
| SHA256: ${{ needs.build.outputs.sha256 }} | |
| files: outputs/${{ needs.build.outputs.name }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |