Skip to content

Commit

Permalink
chore: release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloSanchi committed Dec 24, 2024
1 parent 73d7d47 commit 0daa9a6
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 24 deletions.
32 changes: 24 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

name: Maven Release

on:
workflow_dispatch:
push:
branches:
branches:
- main
workflow_dispatch:

jobs:
release:
Expand All @@ -14,7 +15,23 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Ensures full Git history for Maven release plugin
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Set up Git Author Identity
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Persist SSH Configuration
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
echo "Host github.com" > ~/.ssh/config
echo " StrictHostKeyChecking no" >> ~/.ssh/config
echo " IdentityFile ~/.ssh/id_ed25519" >> ~/.ssh/config
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
- name: Set up JDK
uses: actions/setup-java@v3
Expand All @@ -30,11 +47,10 @@ jobs:
restore-keys: |
${{ runner.os }}-maven
- name: Configure Git with Token
run: |
git remote set-url origin https://x-access-token:${{ secrets.RELEASE_TOKEN }}@github.com/PabloSanchi/jchunk.git
- name: Set Correct Remote URL
run: git remote set-url origin git@github.com:PabloSanchi/jchunk.git

- name: Run Maven Release
run: |
mvn release:prepare -B
mvn release:perform -B
mvn release:prepare -B -e -X
mvn release:perform -B -e -X
6 changes: 3 additions & 3 deletions jchunk-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.github.PabloSanchi</groupId>
<artifactId>jchunk</artifactId>
<version>0.0.0-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>jchunk-core</artifactId>
Expand All @@ -17,7 +17,7 @@
<connection>scm:git:git://github.com/PabloSanchi/jchunk.git</connection>
<developerConnection>scm:git:git@github.com:PabloSanchi/jchunk.git</developerConnection>
<url>https://github.com/PabloSanchi/jchunk</url>
<tag>v0.0.0</tag>
</scm>
<tag>v0.0.0</tag>
</scm>

</project>
6 changes: 3 additions & 3 deletions jchunk-fixed/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.github.PabloSanchi</groupId>
<artifactId>jchunk</artifactId>
<version>0.0.0-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>jchunk-fixed</artifactId>
Expand All @@ -17,8 +17,8 @@
<connection>scm:git:git://github.com/PabloSanchi/jchunk.git</connection>
<developerConnection>scm:git:git@github.com:PabloSanchi/jchunk.git</developerConnection>
<url>https://github.com/PabloSanchi/jchunk</url>
<tag>v0.0.0</tag>
</scm>
<tag>v0.0.0</tag>
</scm>

<dependencies>
<dependency>
Expand Down
6 changes: 3 additions & 3 deletions jchunk-recursive-character/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.github.PabloSanchi</groupId>
<artifactId>jchunk</artifactId>
<version>0.0.0-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>jchunk-recursive-character</artifactId>
Expand All @@ -17,8 +17,8 @@
<connection>scm:git:git://github.com/PabloSanchi/jchunk.git</connection>
<developerConnection>scm:git:git@github.com:PabloSanchi/jchunk.git</developerConnection>
<url>https://github.com/PabloSanchi/jchunk</url>
<tag>v0.0.0</tag>
</scm>
<tag>v0.0.0</tag>
</scm>

<dependencies>
<dependency>
Expand Down
6 changes: 3 additions & 3 deletions jchunk-semantic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.github.PabloSanchi</groupId>
<artifactId>jchunk</artifactId>
<version>0.0.0-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>jchunk-semantic</artifactId>
Expand All @@ -17,8 +17,8 @@
<connection>scm:git:git://github.com/PabloSanchi/jchunk.git</connection>
<developerConnection>scm:git:git@github.com:PabloSanchi/jchunk.git</developerConnection>
<url>https://github.com/PabloSanchi/jchunk</url>
<tag>v0.0.0</tag>
</scm>
<tag>v0.0.0</tag>
</scm>

<dependencies>
<dependency>
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.github.PabloSanchi</groupId>
<artifactId>jchunk</artifactId>
<version>0.0.0-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT</version>

<packaging>pom</packaging>
<url>https://github.com/PabloSanchi/text-chunker-module.git</url>
Expand All @@ -23,7 +23,7 @@
<connection>scm:git:git://github.com/PabloSanchi/jchunk.git</connection>
<developerConnection>scm:git:git@github.com:PabloSanchi/jchunk.git</developerConnection>
<url>https://github.com/PabloSanchi/jchunk</url>
<tag>v0.0.0</tag>
<tag>v0.0.0</tag>
</scm>

<issueManagement>
Expand Down Expand Up @@ -149,8 +149,8 @@
<tagNameFormat>v@{project.version}</tagNameFormat>
<autoVersionSubmodules>true</autoVersionSubmodules>
<pushChanges>true</pushChanges>
<preparationGoals>clean install</preparationGoals>
<goals>deploy</goals>
<preparationGoals>clean verify</preparationGoals>
<goals>none</goals>
</configuration>
</plugin>
<plugin>
Expand Down

0 comments on commit 0daa9a6

Please sign in to comment.