diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..ed9f758 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,19 @@ +name: CI + +on: [pull_request, push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@v1 + - run: | + docker-compose build && docker-compose run --rm --service-ports setup; + ./gradlew clean build --stacktrace -PisCI -Pnosign \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..047d125 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,46 @@ +name: Release + +on: + workflow_dispatch + +jobs: + create_staging_repository: + runs-on: ubuntu-latest + name: Create staging repository + outputs: + repository_id: ${{ steps.create.outputs.repository_id }} + steps: + - id: create + uses: nexus-actions/create-nexus-staging-repo@main + with: + username: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME }} + password: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD }} + staging_profile_id: ${{ secrets.SONATYPE_PROFILE_ID }} + # Defaults to the https://oss.sonatype.org, not https://s01.oss.sonatype.org + base_url: https://s01.oss.sonatype.org/service/local/ + description: ${{ github.repository }}/${{ github.workflow }}#${{ github.run_number }} + + release: + runs-on: ubuntu-latest + needs: [create_staging_repository] + env: + SONATYPE_REPOSITORY_ID: ${{ needs.create_staging_repository.outputs.repository_id }} + SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME }} + SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD }} + NEW_SIGNING_KEY_ID_BASE64: ${{ secrets.NEW_SIGNING_KEY_ID_BASE64 }} + NEW_SIGNING_KEY_ID_BASE64_PASS: ${{ secrets.NEW_SIGNING_KEY_ID_BASE64_PASS }} + GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }} + GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }} + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@v1 + - name: Publish Library + run: ./gradlew clean build :terpal-runtime:publish :terpal-plugin-kotlin:publish :terpal-plugin-gradle:publish -PisCI -no-daemon --stacktrace + - name: Publish Gradle plugin + run: ./gradlew :terpal-plugin-gradle:publishPlugins -PisCI -no-daemon --stacktrace \ No newline at end of file