-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (32 loc) · 1 KB
/
Copy pathpublish.yml
File metadata and controls
40 lines (32 loc) · 1 KB
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
35
36
37
38
39
40
name: Publish to GitHub Packages
on:
release:
types: [published]
jobs:
publish:
name: Publish Library
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Extract version from tag
run: |
TAG="${{ github.event.release.tag_name }}"
VERSION=$(echo "$TAG" | sed -E 's/^v//')
echo "VERSION_NAME=$VERSION" >> $GITHUB_ENV
echo "Publishing version: $VERSION"
- name: Publish to GitHub Packages
run: ./gradlew :stackview:publishReleasePublicationToGitHubPackagesRepository -PVERSION_NAME=${{ env.VERSION_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ github.actor }}