Skip to content

Maven Preview/Release and GitHub Release #386

Maven Preview/Release and GitHub Release

Maven Preview/Release and GitHub Release #386

name: Maven Preview/Release and Github Release
on:
push:
branches: [ dev, feature/6.0 ]
paths-ignore:
- '.gradle/wrapper'
- '.gitignore'
- 'LICENSE'
- 'THIRD PARTY NOTICES'
- '*.md'
workflow_dispatch:
env:
PREVIEW_TASK: publishSnapshotPublicationToSonatypeSnapshotRepository
PUBLISH_TASK: publishMavenCentralReleasePublicationToSonatypeRepository
jobs:
maven_Preview:
if: ${{ github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/feature/6.0' }}
environment:
name: maven_central_snapshot
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 18
distribution: 'adopt'
cache: gradle
- name: Easy detect-secrets
uses: RobertFischer/[email protected]
- name: Download File
run: .\Scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
shell: pwsh
env:
ENCODED_VALUE: ${{ secrets.LOCAL_PROPERTIES }}
OUTPUT_PATH: '.\local.properties'
- name: Download File
run: .\Scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
shell: pwsh
env:
ENCODED_VALUE: ${{ secrets.SECRING_GPG }}
OUTPUT_PATH: '.\secring.gpg'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Publish
run: ./gradlew $PREVIEW_TASK
- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: kiota-drop
path: |
**/libs/*
build/generated-pom.xml
build/generated-pom.xml.asc
build.gradle
gradlew
gradlew.bat
settings.gradle
gradle.properties
**/gradle/**
Scripts/**
maven_Release:
if: ${{ github.ref == 'refs/heads/dev' }}
environment:
name: maven_central_release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 18
distribution: 'adopt'
cache: gradle
- name: Easy detect-secrets
uses: RobertFischer/[email protected]
- name: Download File
run: .\Scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
shell: pwsh
env:
ENCODED_VALUE: ${{ secrets.LOCAL_PROPERTIES }}
OUTPUT_PATH: '.\local.properties'
- name: Download File
run: .\Scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
shell: pwsh
env:
ENCODED_VALUE: ${{ secrets.SECRING_GPG }}
OUTPUT_PATH: '.\secring.gpg'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Publish
run: ./gradlew $PUBLISH_TASK
- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: kiota-drop
path: |
**/libs/*
build/generated-pom.xml
build/generated-pom.xml.asc
build.gradle
gradlew
gradlew.bat
settings.gradle
gradle.properties
**/gradle/**
Scripts/**
create_Tag:
needs: maven_Release
runs-on: ubuntu-latest
env:
RELEASE_TAG: ""
steps:
- uses: actions/checkout@v3
- name: Get Version
id: GetVersion
run: .\Scripts\getLatestVersion.ps1
shell: pwsh
- name: Create tag
uses: rickstaa/[email protected]
with:
tag: ${{ steps.GetVersion.outputs.tag }}
- name: Queue Git Release
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Git Release
token: ${{ secrets.PERSONAL_TOKEN }}
ref: ${{ steps.GetVersion.outputs.tag }}