-
-
Notifications
You must be signed in to change notification settings - Fork 85
67 lines (65 loc) · 2.16 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Publish
on:
release:
types: [ created ]
workflow_dispatch:
jobs:
create-staging-repository:
runs-on: ubuntu-latest
name: Create staging repository
outputs:
repository_id: ${{ steps.create.outputs.repository_id }}
steps:
- id: create
uses: nexus-actions/[email protected]
with:
username: arkivanov
password: ${{ secrets.SONATYPE_PASSWORD }}
staging_profile_id: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
description: Created by GitHub Actions
base_url: https://oss.sonatype.org/service/local/
publish:
name: Publish
runs-on: macos-14
needs: create-staging-repository
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Java
uses: actions/setup-java@v1
with:
java-version: 17
- name: Publish
env:
SONATYPE_REPOSITORY_ID: ${{ needs.create-staging-repository.outputs.repository_id }}
SONATYPE_USER_NAME: ${{ secrets.SONATYPE_USER_NAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
run: ./gradlew publish
close-staging-repository:
name: Close staging repository
runs-on: ubuntu-latest
needs: [ create-staging-repository, publish ]
steps:
- name: Close staging repository
uses: nexus-actions/[email protected]
with:
username: arkivanov
password: ${{ secrets.SONATYPE_PASSWORD }}
staging_repository_id: ${{ needs.create-staging-repository.outputs.repository_id }}
base_url: https://oss.sonatype.org/service/local/
close_only: 'true'
check-publication:
name: Check publication
runs-on: macos-14
needs: close-staging-repository
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Java
uses: actions/setup-java@v1
with:
java-version: 17
- name: Check publication
run: ./gradlew kotlinUpgradeYarnLock :tools:check-publication:build -Pcheck_publication