Skip to content

💚 I give up

💚 I give up #5

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: 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: ${{ release.env.EXECUTABLE == 'true' }}

Check failure on line 49 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / Release

Invalid workflow file

The workflow is not valid. .github/workflows/release.yml (Line: 49, Col: 9): Unrecognized named-value: 'release'. Located at position 1 within expression: release.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: Build with Gradle
run: ./gradlew build -x test -x processCSS
- name: Release modules
run: |
# Iterate over modules
foreach ($module in $env.MODULES) {
echo "Releasing module: $module"
./gradlew $module:publish $module:closeAndReleaseRepository
}
shell: pwsh