Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(release): adjust release process #481

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 25 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
permissions:
contents: write
discussions: write
packages: write

jobs:
release:
Expand All @@ -31,6 +32,13 @@ jobs:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: 'Configure Git'
run: |
git config user.name "Diennea[bot]"
git config user.email "172403682+diennea-bot@users.noreply.github.com"
- uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- id: compute_versions
name: 'Compute versions and branch name'
run: |
Expand Down Expand Up @@ -68,20 +76,31 @@ jobs:
} >> "$GITHUB_OUTPUT"
- if: ${{ inputs.bump == 'major' || inputs.bump == 'minor' }}
name: 'Release ${{ inputs.bump }} version ${{ steps.compute_versions.outputs.release_version }} on branch ${{ steps.compute_versions.outputs.branch_name }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./mvnw release:clean release:branch \
-DbranchName=${{ steps.compute_versions.outputs.branch_name }} \
-DreleaseVersion=${{ steps.compute_versions.outputs.release_version }} \
-DdevelopmentVersion=${{ steps.compute_versions.outputs.release_development_version }}
-DdevelopmentVersion=${{ steps.compute_versions.outputs.release_development_version }} \
-Darguments='-DskipTests=true'
./mvnw release:prepare release:perform \
-DupdateBranchVersions=false \
-DupdateWorkingCopyVersions=false \
-Dtag=${{ steps.compute_versions.outputs.tag }} \
-DreleaseVersion=${{ steps.compute_versions.outputs.release_version }} \
-DdevelopmentVersion=${{ steps.compute_versions.outputs.release_development_version }} \
-Darguments='-DskipTests=true'
- if: ${{ inputs.bump == 'hotfix' }}
name: 'Release ${{ inputs.bump }} version ${{ steps.compute_versions.outputs.release_version }} on branch ${{ steps.compute_versions.outputs.branch_name }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./mvnw release:clean release:prepare \
./mvnw release:clean release:prepare release:perform \
-Dtag=${{ steps.compute_versions.outputs.tag }} \
-DreleaseVersion=${{ steps.compute_versions.outputs.release_version }} \
-DdevelopmentVersion=${{ steps.compute_versions.outputs.release_development_version }}
- name: 'Generate the artifacts'
run: ./mvnw clean install -Pproduction -DskipTests
-DdevelopmentVersion=${{ steps.compute_versions.outputs.release_development_version }} \
-Darguments='-DskipTests=true'
- name: 'Create GitHub Release'
id: create_release
uses: softprops/action-gh-release@v2
Expand All @@ -90,17 +109,4 @@ jobs:
name: Release ${{ steps.compute_versions.outputs.release_version }}
draft: false
prerelease: false
- name: 'Upload ZIP artifact'
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: carapace-server/target/carapace-server-*.zip
asset_name: carapace-server-${{ steps.compute_versions.outputs.release_version }}.zip
asset_content_type: application/zip
- name: 'Upload JAR artifact'
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: carapace-server/target/carapace-server-*.jar
asset_name: carapace-server-${{ steps.compute_versions.outputs.release_version }}.jar
asset_content_type: application/java-archive
files: carapace-server/target/carapace-server-*
14 changes: 11 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,20 @@
</modules>

<scm>
<url>https://github.com/diennea/carapaceproxy.git</url>
<connection>scm:git:https://github.com/diennea/carapaceproxy.git</connection>
<developerConnection>scm:git:https://github.com/diennea/carapaceproxy.git</developerConnection>
<url>git@github.com:diennea/carapaceproxy.git</url>
<connection>scm:git:${project.scm.url}</connection>
<developerConnection>scm:git:${project.scm.url}</developerConnection>
<tag>release/1.11</tag>
</scm>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/diennea/carapaceproxy</url>
</repository>
</distributionManagement>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<toolchain.java.version>21</toolchain.java.version>
Expand Down
Loading