-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
219 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: CodeQL | ||
on: | ||
# @formatter:off | ||
workflow_call: {} | ||
# @formatter:on | ||
schedule: | ||
- cron: 0 0 * * * | ||
jobs: | ||
codeql: | ||
name: CodeQL | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
packages: read | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
- uses: github/codeql-action/init@v2 | ||
with: | ||
languages: java | ||
- run: ./gradlew build | ||
env: | ||
GITHUB_ACTOR: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- uses: github/codeql-action/analyze@v2 | ||
with: | ||
category: /language:java |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Quality Assurance | ||
on: [ pull_request, workflow_call ] | ||
jobs: | ||
# IntelliJ formatter is f*#$ed... | ||
# format: | ||
# name: QA IntelliJ Format | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - uses: actions/setup-java@v3 | ||
# with: | ||
# distribution: temurin | ||
# java-version: 17 | ||
# - uses: telenornorway/setup-intellij@v0 | ||
# - uses: telenornorway/action-intellij-format@v0 | ||
lint: | ||
name: QA IntelliJ Lint | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: read | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
- uses: telenornorway/setup-intellij@v0 | ||
- uses: telenornorway/action-intellij-inspect@v0 | ||
env: | ||
GITHUB_ACTOR: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
||
test: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
- run: ./gradlew test | ||
env: | ||
GITHUB_ACTOR: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
codeql: | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
packages: read | ||
uses: ./.github/workflows/codeql.yml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Release (semver) | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
semver: | ||
type: choice | ||
description: What kind of release is this? | ||
required: true | ||
default: patch | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
message: | ||
type: string | ||
description: An optional release message | ||
required: false | ||
jobs: | ||
quality-assurance: | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
packages: read | ||
name: Quality Assurance | ||
uses: ./.github/workflows/qa.yml | ||
versioning: | ||
name: Versioning | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
if: github.ref == 'refs/heads/main' | ||
outputs: | ||
version: ${{ steps.version.outputs.version }} | ||
steps: | ||
- uses: oss-actions/auto-semver@v0 | ||
id: version | ||
with: | ||
token: ${{ github.token }} | ||
repository: ${{ github.repository }} | ||
type: ${{ inputs.semver }} | ||
vprefix: disabled | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
needs: [ quality-assurance, versioning ] | ||
permissions: | ||
contents: write | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
# region todo(James Bradlee): Find an effective way to do this in a different job and | ||
# download the cache and artifacts for immediate release when | ||
# quality assurance is complete. | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
- name: Build | ||
env: | ||
VERSION: ${{ needs.versioning.outputs.version }} | ||
GITHUB_ACTOR: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: ./gradlew build | ||
- name: Release (packages) | ||
env: | ||
VERSION: ${{ needs.versioning.outputs.version }} | ||
GITHUB_ACTOR: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: ./gradlew publish | ||
# endregion | ||
- name: Release (git tag) | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
VERSION: ${{ needs.versioning.outputs.version }} | ||
TITLE: ${{ inputs.message }} | ||
run: | | ||
git config user.name github-actions[bot] | ||
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | ||
git tag $VERSION | ||
git push -u origin $VERSION | ||
# todo, upload release artifacts | ||
# gh release create --verify-tag -t $TITLE |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Release (snapshot) | ||
on: [ push ] | ||
jobs: | ||
quality-assurance: | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
packages: read | ||
name: Quality Assurance | ||
uses: ./.github/workflows/qa.yml | ||
versioning: | ||
name: Versioning | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
outputs: | ||
version: ${{ steps.version.outputs.version }} | ||
steps: | ||
- id: version | ||
env: | ||
GIT_SHA: ${{ github.sha }} | ||
run: | | ||
echo "version=${GIT_SHA:0:16}-SNAPSHOT" >> $GITHUB_OUTPUT | ||
release: | ||
name: Release (Snapshot) | ||
runs-on: ubuntu-latest | ||
needs: [ quality-assurance, versioning ] | ||
permissions: | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
# region todo(James Bradlee): Find an effective way to do this in a different job and | ||
# download the cache and artifacts for immediate release when | ||
# quality assurance is complete. | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
- name: Build | ||
env: | ||
VERSION: ${{ needs.versioning.outputs.version }} | ||
GITHUB_ACTOR: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: ./gradlew build | ||
- name: Release (packages) | ||
env: | ||
VERSION: ${{ needs.versioning.outputs.version }} | ||
GITHUB_ACTOR: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: ./gradlew publish | ||
# endregion |