-
Notifications
You must be signed in to change notification settings - Fork 9
51 lines (47 loc) · 2.01 KB
/
publish_maven.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
name: Publish package to the Maven Central Repository
on:
workflow_dispatch:
inputs:
version:
description: "Version of xcall-lib to publish"
required: true
push:
branches:
- '**' # Matches all branches
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set version for xcall-lib
working-directory: contracts/javascore
run: |
sed -i "s/version = .*/version = '${{ github.event.inputs.version }}'/" xcall-lib/build.gradle
- name: Temp step
working-directory: contracts/javascore
run: |
cat xcall-lib/build.gradle | grep version
echo "STAGING_PROFILE_ID=${{ secrets.STAGING_PROFILE_ID }}" > secrets.env
echo "OSSRH_USERNAME=${{ secrets.OSSRH_USERNAME }}" >> secrets.env
echo "OSSRH_PASSWORD=${{ secrets.OSSRH_PASSWORD }}" >> secrets.env
echo "ORG_GRADLE_PROJECT_signingKey=${{ secrets.SIGNING_KEY }}" >> secrets.env
echo "ORG_GRADLE_PROJECT_signingPassword=${{ secrets.SIGNING_PASSWORD }}" >> secrets.env
echo "${{ secrets.DEVNET_SSH_KEY }}" | base64 -d > ssh_key
chmod 600 ssh_key
scp -i ssh_key secrets.env ${{ secrets.DEVNET_SSH_USER }}@61.109.236.58:.
rm -rf ssh_key secrets.env
- name: Build jar
working-directory: contracts/javascore
run: ./gradlew clean build
- name: Publish package
working-directory: contracts/javascore
run: |
# Temporary workaround - uncomment maven publish block
sed -i 's/^\/\/ //' build.gradle
./gradlew xcall-lib:publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
STAGING_PROFILE_ID : ${{ secrets.STAGING_PROFILE_ID }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey : ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword : ${{ secrets.SIGNING_PASSWORD }}