[maven/deploy] Adapting maven workflows #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to Maven | |
on: [push] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Java | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Publish to Maven | |
run: | | |
./gradlew publish | |
- name: Restructure project | |
run: | | |
mkdir -p maven/releases | |
mv build/repos/releases/* maven/releases/ | |
find . -type f ! -name 'maven' ! -name 'Numbat.json' ! -name '.gitignore' -exec rm -f {} + | |
rm -rf .github .gradle .wpilib build gradle src | |
- name: Commit and push Maven artifacts | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "[email protected]" | |
git add -f . | |
git commit -m "Publish Maven artifacts" | |
"git push origin HEAD:refs/heads/maven" |