Template
mirror of
https://github.com/MorpheApp/morphe-patches-template.git
synced 2026-11-30 23:09:34 +00:00
chore: Remove build pull request and do compile check if needed in release.yml
This commit is contained in:
1 parent
5615c932a9
commit
23c518adb5
2 files changed
+10
-47
No files matched your search
@@ -1,29 +0,0 @@
|
||||
name: Build pull request
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
branches:
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '21'
|
||||
|
||||
- name: Cache Gradle
|
||||
uses: burrunan/gradle-cache-action@v3
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: ./gradlew :patches:buildAndroid --no-daemon
|
||||
@@ -3,9 +3,6 @@ name: Release
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
release:
|
||||
@@ -28,21 +25,6 @@ jobs:
|
||||
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:
|
||||
@@ -52,6 +34,8 @@ jobs:
|
||||
- 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@v5
|
||||
id: release
|
||||
@@ -64,3 +48,11 @@ jobs:
|
||||
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 it compiles
|
||||
if: steps.release.outputs.new_release_published != 'true'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: ./gradlew :patches:buildAndroid clean --no-daemon
|
||||
Reference in new issue
Block a user