forked from square/anvil
-
Notifications
You must be signed in to change notification settings - Fork 6
34 lines (28 loc) · 1.1 KB
/
publish-snapshot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Publish snapshot
on:
workflow_dispatch:
push:
branches:
- main
jobs:
publish-snapshot:
runs-on: ubuntu-latest
if: github.repository == 'zacsweers/anvil'
timeout-minutes: 25
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
- name: Set version for non-main branch
if: ${{ github.ref_name != 'main' && !startsWith(github.ref, 'refs/tags/') }}
run: |
echo "ORG_GRADLE_PROJECT_VERION_NAME=${{ github.ref_name }}-SNAPSHOT" | sed 's/\//-/g' >> $GITHUB_ENV
- uses: gradle/actions/wrapper-validation@db19848a5fa7950289d3668fb053140cf3028d43 # v3
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4
with:
distribution: 'zulu'
java-version: '17'
check-latest: true
- name: Publish Release 1.9
run: ./gradlew clean publish --no-build-cache --no-daemon --stacktrace
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SonatypeUsername }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SonatypePassword }}