This repository has been archived by the owner on Aug 15, 2024. It is now read-only.
Merge pull request #27 from c4dt/fix-build #134
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: Build and publish Android library | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
branches: | |
- main | |
jobs: | |
build: | |
name: "Build and publish Android library" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Setup Rust toolchain | |
run: rustup show | |
- name: Build | |
run: > | |
./gradlew assembleRelease && | |
jar tvf $( find . -name '*-release.aar' ) | | |
grep '\.so$' | |
- name: Retrieve tag name | |
uses: actions/github-script@v3 | |
id: get-tag | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
# The format for ref is `refs/tags/<tag_name>` | |
script: return context.ref.split('/')[2] | |
result-encoding: string | |
- name: Create tag release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: Release ${{ steps.get-tag.outputs.result }} | |
draft: false | |
files: | | |
./artiwrapper/build/outputs/aar/artiwrapper-release.aar | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish to Maven Central | |
if: startsWith(github.ref, 'refs/tags/') | |
run: ./gradlew publish | |
env: | |
ORG_GRADLE_PROJECT_nexusUsername: ${{ secrets.NEXUS_USERNAME }} | |
ORG_GRADLE_PROJECT_nexusPassword: ${{ secrets.NEXUS_PASSWORD }} | |
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEYID }} | |
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }} | |
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} |