-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (90 loc) · 3.75 KB
/
release.yaml
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
95
96
97
98
99
100
101
102
103
104
name: Release
on:
release:
types: [created]
jobs:
contract-release:
name: Contract File Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Generate Latest Schema Files
uses: actions-rs/cargo@v1
with:
command: run
args: --example schema
- name: Generate Rust Docs
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps
- name: Stage Cargo Docs
run: |
# Add redirect page to inner doc index
echo "<meta http-equiv=\"refresh\" content=\"0; url=group_member_approval_smart_contract\">" >> ./target/doc/index.html
# Create doc deployment location
mkdir ./pages-files
# Move documentation to its configured location in settings
cp -r target/doc ./pages-files/docs
- name: Deploy Docs to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: pages-files
- name: Optimize Contract
run: make optimize
- name: Release Contract Files
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
artifacts/group_member_approval_smart_contract.wasm
artifacts/checksums.txt
schema/*.json
kotlin-tools-release:
name: Publish kotlin-tools Artifacts
runs-on: ubuntu-latest
needs: contract-release
env:
# Needed to allow release version to be fetched and then sent to the publish artifact step
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get Release Version
run: |
# Strip git prefix from version
RELEASE_VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && RELEASE_VERSION=$(echo $RELEASE_VERSION | sed -e 's/^v//')
# Echo derived version for reference
echo "Using version: $RELEASE_VERSION"
# Export release version from step for use in publish artifact step
echo "::set-env name=RELEASE_VERSION::$RELEASE_VERSION"
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
distribution: zulu
- name: Build with Gradle
run: ./kotlin-tools/gradlew clean build --refresh-dependencies -Pversion=$RELEASE_VERSION --project-dir ./kotlin-tools
- name: Install GPG Secret Key
run: |
export GPG_TTY=$(tty)
echo -n "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 --decode | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
echo -n "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 --decode > $GITHUB_WORKSPACE/release.gpg
- name: Publish to Maven Central
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: |
echo "Publishing release for version [$RELEASE_VERSION]"
./kotlin-tools/gradlew publishToSonatype $(if [ "${{github.event.release.prerelease}}" = "true" ]; then echo 'closeSonatypeStagingRepository'; else echo 'closeAndReleaseSonatypeStagingRepository'; fi) \
-Pversion=$RELEASE_VERSION \
-Psigning.keyId="${{ secrets.OSSRH_GPG_SECRET_KEY_ID }}" -Psigning.password="${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}" -Psigning.secretKeyRingFile=$GITHUB_WORKSPACE/release.gpg \
--info \
--project-dir ./kotlin-tools