Release #27
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |