From 45177ae41b89d3b9981554ef884780f1ecf0558e Mon Sep 17 00:00:00 2001 From: Andrey Kuleshov Date: Tue, 11 May 2021 15:07:56 +0300 Subject: [PATCH 1/2] Fixes for release process (#26) Fixes for release process ### What's done: - changed workflow scripts - updated publishing configuration --- .github/workflows/release.yml | 26 ++------------------------ RELEASING.md | 13 +++++++++++++ 2 files changed, 15 insertions(+), 24 deletions(-) create mode 100644 RELEASING.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 274759bd..5e2a7d34 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Create release +name: Create release to Maven Central on: push: @@ -16,7 +16,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-latest, windows-latest ] #, macos-latest ] + os: [ ubuntu-latest, windows-latest, macos-latest ] steps: - name: Checkout uses: actions/checkout@v2.3.3 @@ -29,26 +29,12 @@ jobs: with: arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository gradle-version: wrapper - - name: Upload artifact - id: upload_artifact - uses: actions/upload-artifact@v2 - with: - name: save-cli-${{ runner.os }} - path: save-cli/build/bin/**/releaseExecutable/* - github_release: - needs: release name: Create Github Release runs-on: ubuntu-latest steps: - - - name: Download artifact - uses: actions/download-artifact@v2 - with: - path: tmpFolder - - name: Create Github Release id: create_release uses: actions/create-release@v1 @@ -59,11 +45,3 @@ jobs: release_name: Release ${{ github.ref }} draft: false prerelease: false - - - name: Upload save-cli - id: upload-release-asset - uses: alexellis/upload-assets@0.3.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - asset_paths: '["./tmpFolder/save*"]' diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 00000000..d78a4161 --- /dev/null +++ b/RELEASING.md @@ -0,0 +1,13 @@ +# How to release a new version of diKTat + +* You should have permissions to push to the main repo +* Simply create a new git tag with format `v*` and push it. Github workflow will perform release automatically. + + For example: + ```bash + $ git tag v1.0.0 + $ git push origin --tags + ``` + +After the release workflow has started, version number is determined from tag. Binaries are uploaded to maven repo and +a new github release is created with fat jar. From 884f587937c8dfd47c7de36e8216aad6ff4bf5d1 Mon Sep 17 00:00:00 2001 From: Andrey Kuleshov Date: Tue, 11 May 2021 17:53:17 +0300 Subject: [PATCH 2/2] Bugfix/configuration (#27) Fixes for release process ### What's done: - changed workflow scripts --- .github/workflows/release.yml | 2 +- ktoml-core/build.gradle.kts | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5e2a7d34..43d28657 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-latest, windows-latest, macos-latest ] + os: [ windows-latest, macos-latest ] # ubuntu-latest, ] steps: - name: Checkout uses: actions/checkout@v2.3.3 diff --git a/ktoml-core/build.gradle.kts b/ktoml-core/build.gradle.kts index 112e1f46..410e1643 100644 --- a/ktoml-core/build.gradle.kts +++ b/ktoml-core/build.gradle.kts @@ -16,9 +16,15 @@ kotlin { } } } - linuxX64() - mingwX64() - macosX64() + + val os = org.gradle.nativeplatform.platform.internal.DefaultNativePlatform.getCurrentOperatingSystem() + // Create a target for the host platform. + when { + os.isLinux -> linuxX64() + os.isWindows -> mingwX64() + os.isMacOsX -> macosX64() + else -> throw GradleException("Host OS '${os.name}' is not supported in Kotlin/Native $project.") + } sourceSets { val commonMain by getting {