diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 0d4979e..e8b4ab9 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,12 +13,12 @@ name: "CodeQL" on: push: - branches: [ "main" ] + branches: ["main"] pull_request: # The branches below must be a subset of the branches above - branches: [ "main" ] + branches: ["main"] schedule: - - cron: '43 14 * * 6' + - cron: "43 14 * * 6" jobs: analyze: @@ -30,53 +30,35 @@ jobs: security-events: write steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: java - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: java + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality - - uses: actions/setup-java@v3 - with: - java-version: '16' - distribution: 'temurin' - cache: gradle - - name: Validate Gradle wrapper - uses: gradle/wrapper-validation-action@v1.0.6 + - uses: actions/setup-java@v3 + with: + java-version: "16" + distribution: "temurin" + cache: gradle + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@v1.0.6 - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - uses: actions/setup-java@v3 - # with: - # java-version: '16' - # distribution: 'temurin' - # cache: gradle - # - name: Validate Gradle wrapper - # uses: gradle/wrapper-validation-action@v1.0.6 - # - name: Build with Gradle - # uses: gradle/gradle-build-action - # with: - # arguments: build - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:java" + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:java" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9ed5667..efa9114 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,16 +1,20 @@ name: CI on: push: - branches: [ main ] + branches: [main] jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - java-version: '16' - distribution: 'temurin' + java-version: "16" + distribution: "temurin" cache: gradle - name: Validate Gradle wrapper uses: gradle/wrapper-validation-action@v1.0.6 + - name: Build with Gradle + uses: gradle/gradle-build-action@v2.4.2 + with: + arguments: build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cd8d2f6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: Release + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 16 + uses: actions/setup-java@v3 + with: + java-version: "16" + distribution: "temurin" + cache: gradle + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@v1.0.6 + - name: Publish to GitHub Packages + uses: gradle/gradle-build-action@v2.4.2 + with: + arguments: publish + env: + USERNAME: ${{ github.actor }} + TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/build.gradle.kts b/build.gradle.kts index bc22eeb..2340d47 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -44,7 +44,7 @@ tasks.test { publishing { publications { - register("jpc") { + register("gpr") { from(components["java"]) } }