Skip to content

Commit

Permalink
Separate action for python package
Browse files Browse the repository at this point in the history
  • Loading branch information
tochilinak committed Jul 11, 2024
1 parent 5f32544 commit d30b1b4
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 17 deletions.
20 changes: 3 additions & 17 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,10 @@ jobs:
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Get short commit hash
id: commithash
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: :usvm-python:usvm-python-runner:build :usvm-python:usvm-python-common:build -Pversion=${{ steps.commithash.outputs.sha_short }}
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
# the publishing section of your build.gradle
- name: Publish usvm-python-runner to GitHub Packages
- name: Publish to GitHub Packages
uses: gradle/gradle-build-action@v2
with:
arguments: :usvm-python:usvm-python-runner:publishAllPublicationsToGitHubPackagesRepository :usvm-python:usvm-python-common:publishAllPublicationsToGitHubPackagesRepository -Pversion=${{ steps.commithash.outputs.sha_short }}
arguments: publishAllPublicationsToGitHubPackagesRepository -Pversion=${{ inputs.version }}
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45 changes: 45 additions & 0 deletions .github/workflows/python-runner-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish Package `usvm-python-runner`

on:
workflow_dispatch:
inputs:
version:
description: Release version
type: string
required: true

jobs:
build:

runs-on: [self-hosted, usvm]
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: :usvm-python:usvm-python-runner:build :usvm-python:usvm-python-common:build -Pversion=${{ steps.commithash.outputs.sha_short }}
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
# the publishing section of your build.gradle
- name: Publish usvm-python-runner to GitHub Packages
uses: gradle/gradle-build-action@v2
with:
arguments: :usvm-python:usvm-python-runner:publishAllPublicationsToGitHubPackagesRepository :usvm-python:usvm-python-common:publishAllPublicationsToGitHubPackagesRepository -Pversion=${{ inputs.version }}
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit d30b1b4

Please sign in to comment.