Skip to content

Merge pull request #140 from xmtp/np/update-kotlin-protos #111

Merge pull request #140 from xmtp/np/update-kotlin-protos

Merge pull request #140 from xmtp/np/update-kotlin-protos #111

Workflow file for this run

name: Release
on:
push:
branches:
- main
- beta
jobs:
js:
name: Release (JS)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "lts/*"
- name: Install dependencies
run: npm ci
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run semantic-release
dart:
# The `semantic-release` from JS calculates the version tag
needs: js
if: ${{ github.ref_name == 'main' }}
name: Release (dart)
# https://dart.dev/tools/pub/automated-publishing
permissions:
id-token: write # This is required for requesting the JWT
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46
- run: dart pub get
working-directory: ./dart
- run: dev/dart/generate
- run: dart test
working-directory: ./dart
- name: Set Tag
run: |
TAG=`echo $(git describe --tags --abbrev=0)`
echo "GIT_TAG=${TAG#v}" >> $GITHUB_ENV
- run: dev/dart/prepublish
env:
RELEASE_VERSION: ${{ env.GIT_TAG }}
- name: Verify pubspec
run: cat ./dart/pubspec.yaml
# - run: dart pub publish --force
# working-directory: ./dart
# We can't actually publish to pub.dev from this workflow.
# pub.dev requires the action be triggered by a "tag" (not "branch") push.
# See https://github.com/dart-lang/pub-dev/blob/master/app/lib/package/backend.dart#L1255
# Manual Workaround: (after this workflow completes on a clean checkout)
# $ dev/dart/generate
# $ RELEASE_VERSION=#.#.# dev/dart/prepublish
# $ dart pub publish --force
# TODO: find safer way to automate
kotlin:
# The `semantic-release` from JS calculates the version tag
needs: js
if: ${{ github.ref_name == 'main' }}
name: Release (Kotlin)
runs-on: ubuntu-latest
steps:
- name: Checkout project sources
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Generate protobufs
run: dev/kotlin/generate
- name: Run build with Gradle Wrapper
run: ./gradlew build
- name: Set Tag
run: |
TAG=`echo $(git describe --tags --abbrev=0)`
echo "GIT_TAG=${TAG#v}" >> $GITHUB_ENV
- name: Gradle Publish
env:
RELEASE_VERSION: ${{ env.GIT_TAG }}
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
SIGN_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
SIGN_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
MAVEN_PROFILE_ID: ${{ secrets.MAVEN_PROFILE_ID }}
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository