Skip to content

💚 I give up

💚 I give up #6

Workflow file for this run

name: 'Release'
on:
push:
branches: [ rewrite ]
pull_request:
branches: [ rewrite ]
jobs:
# Only if last commit contains [RELEASE]
check:
runs-on: windows-latest
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: Check Last Commit
id: check_commit
run: |
if ($env:LAST_COMMIT_TITLE -match '\[RELEASE\]') {
echo "::set-output name=executable::true"
} else {
echo "::set-output name=executable::false"
}
shell: pwsh
- name: Extract Modules from Commit Message
id: extract_modules
run: |
$commitMessage = $env:LAST_COMMIT_TITLE
if ($commitMessage -match '\[RELEASE\] Modules: (.*)') {
$modules = $matches[1] -split ', '
echo "::set-output name=modules::$($modules -join ',')"
} else {
echo "::set-output name=modules::"
}
shell: pwsh
outputs:
executable: ${{ steps.check_commit.outputs.executable }}
modules: ${{ steps.extract_modules.outputs.modules }}
release:
runs-on: windows-latest
needs: check
if: ${{ needs.check.outputs.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: Build with Gradle
run: ./gradlew build -x test -x processCSS
- name: Release modules
run: |
# Iterate over modules
$modules = ${{ needs.check.outputs.modules }} -split ','
foreach ($module in $modules) {
echo "Releasing module: $module"
./gradlew $module:publish $module:closeAndReleaseRepository
}
shell: pwsh