64 lines
1.8 KiB
YAML
64 lines
1.8 KiB
YAML
name: Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
|
|
jobs:
|
|
release:
|
|
name: Release
|
|
permissions:
|
|
contents: write
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
java-version: '21'
|
|
|
|
- name: Configure Morphe registry
|
|
env:
|
|
MORPHE_REGISTRY_USERNAME: ${{ secrets.MORPHE_REGISTRY_USERNAME }}
|
|
MORPHE_REGISTRY_TOKEN: ${{ secrets.MORPHE_REGISTRY_TOKEN }}
|
|
run: |
|
|
if [ -z "$MORPHE_REGISTRY_USERNAME" ] || [ -z "$MORPHE_REGISTRY_TOKEN" ]; then
|
|
echo "::error::MORPHE_REGISTRY_USERNAME and MORPHE_REGISTRY_TOKEN secrets are required"
|
|
exit 1
|
|
fi
|
|
umask 077
|
|
mkdir -p "$HOME/.gradle"
|
|
{
|
|
printf 'gpr.user=%s\n' "$MORPHE_REGISTRY_USERNAME"
|
|
printf 'gpr.key=%s\n' "$MORPHE_REGISTRY_TOKEN"
|
|
} >> "$HOME/.gradle/gradle.properties"
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 'lts/*'
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Release
|
|
id: release
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
GITEA_URL: ${{ gitea.server_url }}
|
|
GITEA_REPOSITORY: ${{ gitea.repository }}
|
|
GITEA_REF_NAME: ${{ gitea.ref_name }}
|
|
run: npx semantic-release
|
|
|
|
# Semantic Release performs the Gradle build while publishing. Build only
|
|
# when no release was produced so every push still verifies compilation.
|
|
- name: Verify project compiles
|
|
if: steps.release.outputs.new_release_published != 'true'
|
|
run: ./gradlew :patches:buildAndroid clean --no-daemon
|