forked from the-nft-company/flow-jvm-sdk
-
Notifications
You must be signed in to change notification settings - Fork 16
94 lines (83 loc) · 3.15 KB
/
ci-sdk-publish-snapshot.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Build And Publish Snapshot
on:
push:
branches:
- main
jobs:
build:
name: Build and publish snapshot
runs-on: ubuntu-latest
env:
JAVA_OPTS: -Xmx2g -Dorg.gradle.daemon=false
#services:
# flow-emulator:
# image: gcr.io/flow-container-registry/emulator
# env:
# FLOW_VERBOSE: true
# FLOW_PORT: 3569
# FLOW_INTERVAL: 5s
# FLOW_PERSIST: false
# ports:
# - 3569:3569
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d%H%M%S')"
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: '21'
java-package: jdk
distribution: 'adopt'
- name: Install flow emulator
run: sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)"
- name: Make gradle executable
run: chmod +x ./gradlew
- name: Build
id: build
run: ./gradlew --warning-mode all check build -x test -x integrationTest
- name: Run Unit Tests
id: unit_test
if: ${{ steps.build.outcome == 'success' }}
run: |
export PATH="$HOME/.local/bin:$PATH"
./gradlew --no-daemon --max-workers=2 --warning-mode=all :sdk:test --continue --stacktrace
- name: Publish Unit Test Results
uses: EnricoMi/[email protected]
if: always()
with:
check_name: "Unit Test Results"
files: "**/test-results/test/**/*.xml"
seconds_between_github_writes: 5
secondary_rate_limit_wait_seconds: 120
- name: Run Integration Tests
if: ${{ steps.unit_test.outcome == 'success' }}
run: |
export PATH="$HOME/.local/bin:$PATH"
./gradlew --no-daemon --max-workers=2 --warning-mode=all :sdk:integrationTest --continue --stacktrace
- name: Publish Integration Test Results
uses: EnricoMi/[email protected]
if: always()
with:
check_name: "Integration Test Results"
files: "**/test-results/integrationTest/**/*.xml"
seconds_between_github_writes: 5
secondary_rate_limit_wait_seconds: 120
- name: Publish snapshot
env:
JAVA_OPTS: -Xmx2g -Dorg.gradle.daemon=false
ORG_GRADLE_PROJECT_mavenCentralUsername: '${{ secrets.FLOW_JVM_SDK_SONATYPE_USERNAME }}'
ORG_GRADLE_PROJECT_mavenCentralPassword: '${{ secrets.FLOW_JVM_SDK_SONATYPE_PASSWORD }}'
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.FLOW_JVM_SDK_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.FLOW_JVM_SDK_SIGNING_PASSWORD }}
run: |
if [[ "${{ secrets.FLOW_JVM_SDK_CICD_PUBLISH_ENABLED }}" != "true" ]];
then
exit 0;
fi
./gradlew \
-Psigning.key="${{ secrets.FLOW_JVM_SDK_SIGNING_KEY }}" \
-Psigning.password="${{ secrets.FLOW_JVM_SDK_SIGNING_PASSWORD }}" \
:sdk:publishToMavenCentral --no-configuration-cache