Skip to content

Fix "smart" writing of attributes. While existing prefixes can be #230

Fix "smart" writing of attributes. While existing prefixes can be

Fix "smart" writing of attributes. While existing prefixes can be #230

name: Create and publish a package
on:
push:
branches:
- 'dev'
tags:
- 'v[0-9]*'
workflow_dispatch:
jobs:
create-staging-repository:
name: Create staging repository
runs-on: ubuntu-latest
outputs:
repository_id: ${{ steps.create.outputs.repository_id }}
steps:
- id: create
uses: nexus-actions/[email protected]
with:
username: ${{ secrets.OSSRH_USERNAME }}
password: ${{ secrets.OSSRH_PASSWORD }}
base_url: https://s01.oss.sonatype.org/service/local/
staging_profile_id: ${{ secrets.SONATYPE_PROFILE_ID }}
description: ${{ github.repository }}/${{ github.workflow }}#${{ github.run_number }}
build-and-publish:
needs: create-staging-repository
runs-on: ${{ matrix.os }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_PRIV_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
strategy:
matrix:
# os: [ macOs-latest, windows-latest, ubuntu-latest ]
os: [ macOs-latest ]
steps:
- name: Checkout
uses: actions/[email protected]
- name: Cached konan
uses: actions/[email protected]
with:
path: ~/.konan
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-konan-
- name: Set up JDK 11
uses: actions/[email protected]
with:
java-version: '11'
distribution: 'temurin'
- id: cache-gradle-windows
name: Set up gradle
uses: gradle/actions/[email protected]
- name: Check (macos / windows)
if: matrix.os != 'ubuntu-latest'
run: ./gradlew -PexcludeSchema nativeTest --stacktrace
shell: bash
- name: Check (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: ./gradlew -PexcludeSchema check --stacktrace
shell: bash
- name: Store reports
if: failure()
uses: actions/[email protected]
with:
name: reports
path: |
**/build/reports/
**/build/test-results/
- name: Upload (macOs)
if: matrix.os == 'macOs-latest'
run: ./gradlew -PexcludeSchema publish -Pxmlutil.repositoryId='${{ needs.create-staging-repository.outputs.repository_id }}' -Possrh.username='${{ secrets.OSSRH_USERNAME }}' -Possrh.password='${{ secrets.OSSRH_PASSWORD }}' -Pnative.deploy=all --stacktrace
shell: bash
drop-on-failure:
needs: [ create-staging-repository, build-and-publish ]
runs-on: ubuntu-latest
if: ${{ always() && needs.create_staging_repository.result == 'success' }}
steps:
- name: Discard
if: ${{ needs.build-and-publish != 'success' }}
uses: nexus-actions/drop-nexus-staging-repo@v1
with:
username: ${{ secrets.OSSRH_USERNAME }}
password: ${{ secrets.OSSRH_PASSWORD }}
staging_repository_id: ${{ needs.create_staging_repository.outputs.repository_id }}