Skip to content

Commit

Permalink
🔖 [RELEASE] Modules: core, effects, resources, components, release
Browse files Browse the repository at this point in the history
(to trigger the new release action)
  • Loading branch information
palexdev committed Jun 7, 2024
2 parents 5271a1e + bc6ed17 commit 303f78f
Showing 1 changed file with 86 additions and 0 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: 'Release new versions'
on:
workflow_run:
workflows: [Build rewrite]
types:
- completed

jobs:
# Jobs will run only and only if the build action was successful
check-build:
runs-on: windows-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}

# Only commits containing [RELEASE] will trigger this action
check-commit:
runs-on: windows-latest
needs: check-build
steps:
- name: Checkout code
- uses: actions/checkout@v3

- name: Get Last Commit
run: |
$val = git show --pretty=format:"%s" -s HEAD
echo "MESSAGE=$val" >> $env.GITHUB_ENV
shell: pwsh

- name: Extract Modules from Commit Message
run: |
$commitMessage = $env:LAST_COMMIT_TITLE
$modules = [regex]::Matches($commitMessage, '(?<=\[RELEASE\] Modules: )([^,]+)')
$moduleList = @()
foreach ($module in $modules) {
$moduleList += $module.Value.Trim()
}
echo "MODULES=$moduleList" >> $env:GITHUB_ENV
shell: pwsh

- name: Check Last Commit
run: |
if ($env:LAST_COMMIT_TITLE -match '\[RELEASE\]') {
echo "EXECUTABLE=true" >> $env:GITHUB_ENV
} else {
echo "EXECUTABLE=false" >> $env:GITHUB_ENV
}
shell: pwsh

release:
runs-on: windows-latest
needs: check-commit
env:
MESSAGE: ${{ needs.check-commit.env.MESSAGE }}
MODULES: ${{ needs.check-commit.env.MODULES }}
EXECUTABLE: ${{ needs.check-commit.env.EXECUTABLE }}
if: ${{ env.EXECUTABLE == 'true' }}

steps:
- name: Checkout code
- uses: actions/checkout@v3

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '21'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Release modules
run: |
# Iterate over modules
foreach ($module in $env.MODULES) {
echo "Releasing module: $module"
./gradlew $module:publish $module:closeAndReleaseRepository
}
shell: pwsh









0 comments on commit 303f78f

Please sign in to comment.