Skip to content

Commit

Permalink
Fix release process
Browse files Browse the repository at this point in the history
  • Loading branch information
joschi committed Aug 28, 2024
1 parent 8ce4274 commit 0d3854d
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 89 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Build
# yamllint disable-line rule:truthy
on:
push:
branches:
- release/*
pull_request:
jobs:
yamllint:
uses: dropwizard/workflows/.github/workflows/yamllint.yml@main
build:
strategy:
fail-fast: false
matrix:
java-version: ['11', '17', '21']
uses: dropwizard/workflows/.github/workflows/maven.yml@main
secrets: inherit
with:
java-version: ${{ matrix.java-version }}
29 changes: 0 additions & 29 deletions .github/workflows/maven.yml

This file was deleted.

28 changes: 5 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,11 @@
---
name: Release
# yamllint disable-line rule:truthy
on:
push:
tags:
- 'v*'
- 'v*'
jobs:
release:
runs-on: 'ubuntu-latest'
env:
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up JDK
uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4
with:
distribution: 'zulu'
java-version: '11'
cache: 'maven'
server-id: ossrh
server-username: CI_DEPLOY_USERNAME
server-password: CI_DEPLOY_PASSWORD
gpg-passphrase: GPG_PASSPHRASE
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Build and Deploy
run: ./mvnw -B -V -ntp -DperformRelease=true deploy
env:
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
uses: dropwizard/workflows/.github/workflows/release.yml@main
secrets: inherit
65 changes: 28 additions & 37 deletions .github/workflows/trigger-release.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
---
# yamllint disable rule:line-length
name: Trigger Release
# yamllint disable-line rule:truthy
on:
workflow_dispatch:
inputs:
releaseVersion:
description: 'Version of the next release'
required: true
developmentVersion:
description: 'Version of the next development cycle (must end in "-SNAPSHOT")'
required: true
jobs:
trigger-release:
runs-on: 'ubuntu-latest'
Expand All @@ -16,33 +12,28 @@ jobs:
env:
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
steps:
- uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 # v0.9.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Set up JDK
uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4
with:
distribution: 'zulu'
java-version: '17'
cache: 'maven'
server-id: ossrh
server-username: ${{ secrets.CI_DEPLOY_USERNAME }}
server-password: ${{ secrets.CI_DEPLOY_PASSWORD }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Set up Git
run: |
git config --global committer.email "[email protected]"
git config --global committer.name "Dropwizard Release Action"
git config --global author.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global author.name "${GITHUB_ACTOR}"
- name: Prepare release
run: ./mvnw -V -B -ntp -Prelease -DreleaseVersion=${{ inputs.releaseVersion }} -DdevelopmentVersion=${{ inputs.developmentVersion }} release:prepare
- name: Rollback on failure
if: failure()
run: |
./mvnw -B release:rollback -Prelease
echo "You may need to manually delete the GitHub tag, if it was created."
- uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 # v0.9.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Set up JDK
uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4
with:
distribution: 'zulu'
java-version: '17'
cache: 'maven'
server-id: ossrh
server-username: ${{ secrets.CI_DEPLOY_USERNAME }}
server-password: ${{ secrets.CI_DEPLOY_PASSWORD }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Set up Git
run: |
git config --global committer.email "[email protected]"
git config --global committer.name "Dropwizard Release Action"
git config --global author.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global author.name "${GITHUB_ACTOR}"
- name: Tag release
run: ./mvnw -V -B -ntp -Prelease scm:tag
22 changes: 22 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
A collection of Maven Archetypes for bootstrapping development of a new Dropwizard Service.
</description>

<scm>
<connection>scm:git:https://github.com/dropwizard/dropwizard-archetypes</connection>
<developerConnection>scm:git:ssh://[email protected]/dropwizard/dropwizard-archetypes.git</developerConnection>
<url>https://github.com/dropwizard/dropwizard-archetypes</url>
</scm>

<modules>
<module>java-simple</module>
</modules>
Expand Down Expand Up @@ -172,5 +178,21 @@
<invoker.skip>true</invoker.skip>
</properties>
</profile>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>2.1.0</version>
<configuration>
<connectionType>developerConnection</connectionType>
<tag>v${project.version}</tag>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit 0d3854d

Please sign in to comment.