Skip to content

Commit

Permalink
🔖 [RELEASE] Modules: core, effects, resources, components, release
Browse files Browse the repository at this point in the history
(sorry for this mess :crying:)

Signed-off-by: palexdev <alessandro.parisi406@gmail.com>
  • Loading branch information
palexdev committed Jun 7, 2024
1 parent 2b9c717 commit f5fe510
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
github: palexdev
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
ko_fi: palexdev
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: 'Build rewrite'

on:
Expand All @@ -9,6 +6,9 @@ on:
pull_request:
branches: [ rewrite ]

env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'

jobs:
# Only if last commit does not contain [RELEASE]
check:
Expand All @@ -19,14 +19,14 @@ jobs:

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

- name: Check Last Commit
id: check_commit
run: |
if ($env:LAST_COMMIT_TITLE -match '\[RELEASE\]') {
if ($env:CommitMessage -match '\[RELEASE\]') {
echo "::set-output name=executable::true"
} else {
echo "::set-output name=executable::false"
Expand Down
34 changes: 26 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
name: 'Release'

on:
push:
branches: [ rewrite ]
pull_request:
branches: [ rewrite ]


env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'

jobs:
# Only if last commit contains [RELEASE]
check:
Expand All @@ -15,14 +19,14 @@ jobs:

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

- name: Check Last Commit
id: check_commit
run: |
if ($env:LAST_COMMIT_TITLE -match '\[RELEASE\]') {
if ($env:CommitMessage -match '\[RELEASE\]') {
echo "::set-output name=executable::true"
} else {
echo "::set-output name=executable::false"
Expand All @@ -32,8 +36,7 @@ jobs:
- name: Extract Modules from Commit Message
id: extract_modules
run: |
$commitMessage = $env:LAST_COMMIT_TITLE
if ($commitMessage -match '\[RELEASE\] Modules: (.*)') {
if ($env:CommitMessage -match '\[RELEASE\] Modules: (.*)') {
$modules = $matches[1] -split ', '
echo "::set-output name=modules::$($modules -join ',')"
} else {
Expand All @@ -46,9 +49,16 @@ jobs:
modules: ${{ steps.extract_modules.outputs.modules }}

release:
environment: MavenEnv
runs-on: windows-latest
needs: check
if: ${{ needs.check.outputs.executable == 'true' }}
env:
mavenCentralUsername = ${{ secrets.MAVEN_USERNAME }}
mavenCentralPassword = ${{ secrets.MAVEN_PASSWORD }}
signing.keyId = ${{ secrets.GPG_ID }}
signing.password = ${{ secrets.GPG_PASSWORD }}
signing.secretKeyRingFile = ${{ secrets.GPG_KEY }}

steps:
- name: Checkout code
Expand All @@ -69,10 +79,18 @@ jobs:
- name: Release modules
run: |
# Iterate over modules
$modules = ${{ needs.check.outputs.modules }} -split ','
$modules = "${{ needs.check.outputs.modules }}" -split ','
foreach ($module in $modules) {
echo "Releasing module: $module"
./gradlew $module:publish $module:closeAndReleaseRepository
switch ($module) {
"core" { ./gradlew core:publish core:closeAndReleaseRepository }
"resources" { ./gradlew resources:publish resources:closeAndReleaseRepository }
"effects" { ./gradlew effects:publish effects:closeAndReleaseRepository }
"localization" { ./gradlew localization:publish localization:closeAndReleaseRepository }
"components" { ./gradlew components:publish components:closeAndReleaseRepository }
"release" { ./gradlew release:publish release:closeAndReleaseRepository }
default { Write-Host "Unrecognized module" }
}
}
shell: pwsh

Expand Down

0 comments on commit f5fe510

Please sign in to comment.