59 lines
1.6 KiB
YAML
59 lines
1.6 KiB
YAML
name: Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
|
|
jobs:
|
|
release:
|
|
name: Release
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
id-token: write
|
|
attestations: write
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v5.7.0
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: '21'
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v7
|
|
with:
|
|
node-version: 'lts/*'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
# Semantic release runs its own Gradle build command.
|
|
# Only dev and main branch will generate a release as specified by .releaserc
|
|
- name: Release
|
|
uses: cycjimmy/semantic-release-action@v6
|
|
id: release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Attest
|
|
if: steps.release.outputs.new_release_published == 'true'
|
|
uses: actions/attest-build-provenance@v4
|
|
with:
|
|
subject-name: 'Morphe Patches ${{ steps.release.outputs.new_release_git_tag }}'
|
|
subject-path: patches/build/libs/patches-*.mpp
|
|
|
|
# Always verify compilation when semantic-release did not publish a release.
|
|
# This covers non-main/dev branches, chore commits, docs commits, etc.
|
|
- name: Verify project compiles
|
|
if: steps.release.outputs.new_release_published != 'true'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: ./gradlew :patches:buildAndroid clean --no-daemon
|