Files
morphe-patches-template/.github/workflows/release.yml
T

67 lines
1.7 KiB
YAML

name: Release
on:
workflow_dispatch:
push:
branches:
- main
- dev
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
with:
distribution: 'temurin'
java-version: '21'
# Verify the build isn't broken. This is required for
# chore commits where semantic release doesn't run.
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew :patches:buildAndroid
# Cleaning up is necessary otherwise semantic release will create two artifacts,
# One artifact of the current release number and a second of the new release.
# Semantic release runs its own compilation step and
- name: Cleanup build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew clean
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Release
uses: cycjimmy/semantic-release-action@v5
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