Skip to content

try renaming artifact & groupid in pom for github #29

try renaming artifact & groupid in pom for github

try renaming artifact & groupid in pom for github #29

Workflow file for this run

name: Java
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: macos-latest
name: Java ${{ matrix.java }}
strategy:
matrix:
java:
- '17' # EOL: 2026-09
- '21' # EOL: 2028-09
#- '22' # REL: 2024-03
#- '23' # REL: 2024-09
#- '24' # REL: 2025-03
#- '25' # REL: 2025-09
# see supported java release schedule at https://www.oracle.com/java/technologies/java-se-support-roadmap.html
steps:
- uses: actions/checkout@v4
with:
repository: getargv/getargv
path: getargv
token: ${{ secrets.GH_PAT }}
- name: Build libgetargv
run: make install_dylib
working-directory: getargv
- uses: actions/checkout@v4
with:
path: getargv.java
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: maven
check-latest: true
- name: Build with Maven
run: mvn -B package --file pom.xml
working-directory: getargv.java
- name: Test with Maven
run: mvn -B test --file pom.xml
working-directory: getargv.java
release:
permissions:
contents: write
packages: write
needs: [ build ]
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
repository: getargv/getargv
path: getargv
token: ${{ secrets.GH_PAT }}
- name: Build libgetargv
run: make install_dylib
working-directory: getargv
- uses: actions/checkout@v4
with:
path: getargv.java
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
check-latest: true
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-passphrase: MAVEN_GPG_PASSPHRASE
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
- name: Publish package to Maven Central
run: make release
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
working-directory: getargv.java
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
check-latest: true
server-id: github
- name: fix artifactid & groupid in pom
run: sed -e 's/artifactId>Getargv</artifactId>getargv</g' -e 's/groupId>cam.narzt.getargv</groupId>github.getargv</g' -i '' pom.xml
working-directory: getargv.java
- name: Publish package to GitHub Packages
run: mvn -DuseGithub=true --batch-mode deploy
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_ACTOR: getargv
working-directory: getargv.java