Skip to content

Commit

Permalink
Update workflows for publishing after the release
Browse files Browse the repository at this point in the history
  • Loading branch information
whyoleg committed May 29, 2024
1 parent 90493bf commit 1d1b079
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 50 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
name: Dev CI
on:
pull_request:
paths-ignore:
- samples/**
push:
paths-ignore:
- samples/**
branches-ignore:
- master
branches:
- ci/**

jobs:
test:
uses: ./.github/workflows/run-tests.yml
publish:
needs: [ test ]
uses: ./.github/workflows/publish-snapshot.yml
secrets: inherit
with:
add-branch-suffix: true
2 changes: 0 additions & 2 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,3 @@ jobs:
needs: [ test ]
uses: ./.github/workflows/publish-snapshot.yml
secrets: inherit
with:
add-branch-suffix: false
9 changes: 0 additions & 9 deletions .github/workflows/ci-pr.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ on:
- '*'

jobs:
# test:
# uses: ./.github/workflows/run-tests.yml
test:
uses: ./.github/workflows/run-tests.yml
publish:
# needs: [ test ]
needs: [ test ]
uses: ./.github/workflows/publish-release.yml
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/ci-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-14 ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
sample: [ chat ]
steps:
- uses: actions/checkout@v4
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Publish RELEASE to Maven Central
on:
workflow_call:
on: [ workflow_call ]

concurrency:
group: publish-release
Expand All @@ -9,7 +8,7 @@ concurrency:
jobs:
publish:
if: github.repository == 'rsocket/rsocket-kotlin'
runs-on: macos-14
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-gradle
Expand Down
24 changes: 6 additions & 18 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,22 @@
name: Publish SNAPSHOT to Github Packages
on:
workflow_call:
inputs:
add-branch-suffix:
type: boolean
required: true
name: Publish SNAPSHOT to Maven Central
on: [ workflow_call ]

concurrency:
group: publish-snapshot-${{ github.ref_name }}
group: publish-snapshot
cancel-in-progress: false

jobs:
publish:
if: github.repository == 'rsocket/rsocket-kotlin'
runs-on: macos-14
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-gradle
with:
cache-read-only: true

- if: inputs.add-branch-suffix
id: set-version
run: |
ref_name=${{ github.ref_name }}
branch_name="${ref_name////-}"
echo "::set-output name=version-suffix::$branch_name"
cache-disabled: true

- name: Publish snapshot to Maven Central
run: ./gradlew publishToMavenCentral -Pversion=0.16.0-${{ steps.set-version.outputs.version-suffix }}-SNAPSHOT --no-configuration-cache
run: ./gradlew publishToMavenCentral -Pversion=0.17.0-SNAPSHOT --no-configuration-cache
env:
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{secrets.signingKey}}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{secrets.signingPassword}}
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,31 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-latest', 'macos-14', 'windows-latest' ]
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-gradle
with:
cache-read-only: ${{ github.ref_name != 'main' }}
cache-read-only: ${{ github.ref_name != 'master' }}

- run: ./gradlew build publishToMavenLocal --continue -Prsocketbuild.skipTests=true

run-tests:
needs: [ build-project ]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-latest' ]
target: [ 'jvm', 'jvm11', 'jvm17', 'jvm21', 'js', 'native' ]
include:
- os: 'macos-14'
- os: 'macos-latest'
target: 'macos'
- os: 'macos-14'
- os: 'macos-latest'
target: 'ios'
- os: 'macos-14'
- os: 'macos-latest'
target: 'watchos'
- os: 'macos-14'
- os: 'macos-latest'
target: 'tvos'
- os: 'windows-latest'
target: 'native'
Expand Down

0 comments on commit 1d1b079

Please sign in to comment.