Create release #65
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'version' | |
default: '0.0.0' | |
required: true | |
prerelease: | |
type: choice | |
description: 'prelease' | |
default: false | |
options: | |
- false | |
- true | |
permissions: write-all | |
env: | |
OSSH_USERNAME: ${{ secrets.OSSH_USERNAME }} | |
OSSH_PASSWORD: ${{ secrets.OSSH_PASSWORD }} | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASS }} | |
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }} | |
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }} | |
jobs: | |
pre-build: | |
#if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'sample/') | |
name: Publish library at mavenCentral | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'zulu' | |
cache: gradle | |
- name: Replace keys | |
run: | | |
AWS_ACCESS_KEY=${{ secrets.AWS_ACCESS_KEY }} | |
AWS_SECRET_KEY=${{ secrets.AWS_SECRET_KEY }} | |
AWS_ACCESS_KEY_SCAPE=$(echo "$AWS_ACCESS_KEY" | sed 's/[\&/]/\\&/g') | |
AWS_SECRET_KEY_SCAPE=$(echo "$AWS_SECRET_KEY" | sed 's/[\&/]/\\&/g') | |
sed -i '' "s|private val accessKey = .*|private val accessKey = \"$AWS_ACCESS_KEY\"|g" aws-s3/src/commonTest/kotlin/com/estivensh4/s3/AWSS3CommonTest.kt | |
sed -i '' "s|private val secretKey = .*|private val secretKey = \"$AWS_SECRET_KEY\"|g" aws-s3/src/commonTest/kotlin/com/estivensh4/s3/AWSS3CommonTest.kt | |
sed -i '' "s|private val accessKey = .*|private val accessKey = \"$AWS_ACCESS_KEY\"|g" aws-dynamo/src/commonTest/kotlin/com/estivensh4/dynamo/AWSDynamoTest.kt | |
sed -i '' "s|private val secretKey = .*|private val secretKey = \"$AWS_SECRET_KEY\"|g" aws-dynamo/src/commonTest/kotlin/com/estivensh4/dynamo/AWSDynamoTest.kt | |
cat aws-s3/src/commonTest/kotlin/com/estivensh4/s3/AWSS3CommonTest.kt | |
working-directory: ${{ github.workspace }}/ | |
- name: Prebuild library | |
run: ./gradlew publishToMavenLocal | |
- name: Publish library | |
run: ./gradlew publish --no-parallel | |
release: | |
# if: github.event_name == 'pull_request' && github.event.action == 'opened' && startsWith(github.event.pull_request.head.ref, 'sample/') | |
name: Create release v${{ github.event.inputs.version }} | |
needs: pre-build | |
runs-on: self-hosted | |
steps: | |
- name: Create Release | |
id: create_release | |
uses: comnoco/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
commitish: ${{ github.ref }} | |
tag_name: release/${{ github.event.inputs.version }} | |
release_name: v${{ github.event.inputs.version }} | |
body: "Will be filled later" | |
draft: false | |
prerelease: ${{ github.event.inputs.prerelease }} |