Skip to content

Commit

Permalink
First actions & workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
SalomonBrys committed Nov 22, 2023
1 parent e6f2dfe commit d62c0ef
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[*.yml]
indent_style = space
indent_size = 2
27 changes: 27 additions & 0 deletions .github/workflows/create-nexus-staging-repository.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on:
workflow_call:
secrets:
SONATYPE_USERNAME:
required: true
SONATYPE_PASSWORD:
required: true
SONATYPE_PROFILE_ID:
required: true
outputs:
repository-id: ${{ jobs.create-staging-repository.outputs.repository-id }}

jobs:
create-staging-repository:
name: Create Nexus staging repository
runs-on: ubuntu-latest
outputs:
repository-id: ${{ steps.create.outputs.repository_id }}
steps:
- id: create
uses: nexus-actions/create-nexus-staging-repo@v1
with:
base_url: https://s01.oss.sonatype.org/service/local/
username: ${{ secrets.SONATYPE_USERNAME }}
password: ${{ secrets.SONATYPE_PASSWORD }}
staging_profile_id: ${{ secrets.SONATYPE_PROFILE_ID }}
description: ${{ github.repository }}/${{ github.workflow }}#${{ github.run_number }}
34 changes: 34 additions & 0 deletions .github/workflows/drop-or-release-nexus-staging-repository.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
workflow_call:
inputs:
repository-id:
required: true
build-upload-result:
required: true
secrets:
SONATYPE_USERNAME:
required: true
SONATYPE_PASSWORD:
required: true

jobs:
complete-staging-repository:
name: Complete Nexus staging repository
runs-on: ubuntu-latest
steps:
- name: Discard
if: ${{ input.build-upload-result != 'success' }}
uses: nexus-actions/drop-nexus-staging-repo@v1
with:
base_url: https://s01.oss.sonatype.org/service/local/
username: ${{ secrets.SONATYPE_USERNAME }}
password: ${{ secrets.SONATYPE_PASSWORD }}
staging_repository_id: ${{ inputs.repository-id }}
- name: Release
if: ${{ input.build-upload-result == 'success' }}
uses: nexus-actions/release-nexus-staging-repo@v1
with:
base_url: https://s01.oss.sonatype.org/service/local/
username: ${{ secrets.SONATYPE_USERNAME }}
password: ${{ secrets.SONATYPE_PASSWORD }}
staging_repository_id: ${{ inputs.repository-id }}
25 changes: 25 additions & 0 deletions setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Setup"
inputs:
java-version:
default: 17
with-konan:
default: true
runs:
using: "composite"
steps:
- name: Check out
uses: actions/checkout@v4
- name: Set up JDK Temurin ${{ inputs.java-version }}
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ inputs.java-version }}
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Cached Konan
if: ${{ inputs.with-konan }}
uses: actions/cache@v3
with:
path: ~/.konan
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-konan-

0 comments on commit d62c0ef

Please sign in to comment.