Skip to content

Commit

Permalink
fix names in release workflow (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy2003 committed Jun 20, 2024
1 parent 78eaee5 commit bee28a4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-maven-cache/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ runs:
using: "composite"
steps:
- name: Cache Maven packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand Down
58 changes: 13 additions & 45 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ on:
workflow_dispatch: { }

jobs:
build_and_deploy:
name: Build and Deploy to Maven Central
build:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-jdk
- uses: ./.github/actions/setup-maven-cache
- uses: ./.github/actions/run-tests

- name: Prepare for release
run: ./mvnw versions:set -DremoveSnapshot=true -DgenerateBackupPoms=false
Expand All @@ -20,25 +19,9 @@ jobs:
id: get_version
run: echo "VERSION=$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_ENV

- name: Deploy
- name: Build
run: ./mvnw -P release --batch-mode -DskipTests package

- name: Upload JARs as artifact
uses: actions/upload-artifact@v2
with:
name: jars
path: ./target/*.jar

commit_and_tag:
name: Commit and Tag
needs: build_and_deploy
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/setup-jdk

- name: Set version
run: ./mvnw versions:set -DnewVersion=${{ env.VERSION }} -DgenerateBackupPoms=false

- name: Update README.md
run: sed -i "s|<version>.*</version>|<version>${{ env.VERSION }}</version>|g" README.md

Expand All @@ -61,17 +44,7 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}

create_github_release_and_attach_artifacts:
name: Create GitHub Release and attach artifacts
needs: commit_and_tag
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: build-artifacts
path: ./target
tags: true

- name: Build Changelog
id: build_changelog
Expand All @@ -87,20 +60,15 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.output.version }}
release_name: Release ${{ steps.get_version.output.version }}
draft: false
prerelease: false
tag_name: ${{ env.VERSION }}
release_name: Release ${{ env.VERSION }}
draft: true
prerelease: true
body: ${{steps.build_changelog.outputs.changelog}}

- name: Upload all jars to Release
run: |
for file in ./target/*.jar; do
echo "Uploading $file"
curl \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: $(file -b --mime-type $file)" \
--data-binary @"$file" \
"${{ steps.create_release.outputs.upload_url }}?name=$(basename $file)"
done
shell: bash
uses: AButler/[email protected]
with:
files: "target/*.jar"
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-id: ${{ steps.create_release.outputs.id }}
13 changes: 0 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -480,19 +480,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
Expand Down

0 comments on commit bee28a4

Please sign in to comment.