41 lines
1.3 KiB
YAML
41 lines
1.3 KiB
YAML
name: Publish to Reposilite
|
|
|
|
on:
|
|
push:
|
|
tags: ['v*', '[0-9]*']
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
java-version: '21'
|
|
- name: Require Reposilite credentials
|
|
env:
|
|
REPOSILITE_USERNAME: ${{ secrets.REPOSILITE_USERNAME }}
|
|
REPOSILITE_PASSWORD: ${{ secrets.REPOSILITE_PASSWORD }}
|
|
run: |
|
|
test -n "$REPOSILITE_USERNAME" || { echo 'Missing REPOSILITE_USERNAME secret'; exit 1; }
|
|
test -n "$REPOSILITE_PASSWORD" || { echo 'Missing REPOSILITE_PASSWORD secret'; exit 1; }
|
|
- name: Resolve release version from tag
|
|
shell: bash
|
|
run: |
|
|
case "$GITHUB_REF" in
|
|
refs/tags/*) echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> "$GITHUB_ENV" ;;
|
|
*) echo 'Publishing must be run from a release tag (for example v1.2.3)' >&2; exit 1 ;;
|
|
esac
|
|
- name: Publish release
|
|
env:
|
|
REPOSILITE_USERNAME: ${{ secrets.REPOSILITE_USERNAME }}
|
|
REPOSILITE_PASSWORD: ${{ secrets.REPOSILITE_PASSWORD }}
|
|
run: ./gradlew --no-daemon clean test publish
|