Skip to content

Commit

Permalink
add maven release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
j178 committed Dec 9, 2023
1 parent 485ed39 commit 595a1bd
Show file tree
Hide file tree
Showing 14 changed files with 778 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,27 @@ jobs:
env:
RUST_BACKTRACE: 1
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

release_maven:
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/testutils/java/v')"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
server-id: 'central'
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Publish to Apache Maven Central
working-directory: testutils/java
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ""
run:
./mvnw clean deploy -DskipTests=true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ go.work
go.work.sum
misc/*.gif
misc/questions.json

testutils/java/target/
testutils/java/.idea/
4 changes: 4 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
before:
hooks:
- go mod tidy
- go generate ./...
- ./scripts/completions.sh
builds:
- env:
Expand All @@ -12,6 +13,9 @@ builds:
goarch:
- amd64
- arm64
ignore:
- goos: linux
goarch: arm64
flags:
- -v
- -trimpath
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ release-pypi:
release-cargo:
git tag -a $(shell svu patch --prefix 'testutils/rust/')
git push --tags

release-maven:
git tag -a $(shell svu patch --prefix 'testutils/java/')
git push --tags
Binary file added testutils/java/.mvn/wrapper/maven-wrapper.jar
Binary file not shown.
18 changes: 18 additions & 0 deletions testutils/java/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
10 changes: 10 additions & 0 deletions testutils/java/Note.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# mvn wrapper

mvn wraper:wraper

# GPG keys

gpg --full-generate-key
gpg --list-secret-keys --keyid-format=long
gpg --list-signatures --keyid-format 0xshort
gpg --keyserver keyserver.ubuntu.com --send-keys 48B96ED2
8 changes: 8 additions & 0 deletions testutils/java/embed.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package java

import (
"embed"
)

//go:embed mvnw mvnw.cmd .mvn
var MvnWrapper embed.FS
Loading

0 comments on commit 595a1bd

Please sign in to comment.