-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
15 changed files
with
7,841 additions
and
13 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
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,9 @@ | ||
# | ||
# https://help.github.com/articles/dealing-with-line-endings/ | ||
# | ||
# Linux start script should use lf | ||
/gradlew text eol=lf | ||
|
||
# These are Windows script files and should use crlf | ||
*.bat text eol=crlf | ||
|
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,26 @@ | ||
name: Open a PR to main | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
workflow_dispatch: | ||
|
||
env: | ||
MESSAGE: Merge branch `${{ github.head_ref || github.ref_name }}` to `main` | ||
|
||
jobs: | ||
pull-request: | ||
name: Open pull request | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Open pull request | ||
uses: repo-sync/pull-request@v2 | ||
with: | ||
destination_branch: 'main' | ||
pr_title: 'chore: ${{ env.MESSAGE }}' | ||
pr_body: 'This pull request will ${{ env.MESSAGE }}.' | ||
pr_draft: true |
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,89 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
pull_request: | ||
branches: | ||
- main | ||
- dev | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
# Make sure the release step uses its own credentials: | ||
# https://github.com/cycjimmy/semantic-release-action#private-packages | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
|
||
- name: Cache Gradle | ||
uses: burrunan/gradle-cache-action@v1 | ||
|
||
- name: Build | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: ./gradlew build clean | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "lts/*" | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }} | ||
run: npm exec semantic-release | ||
|
||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
image: tonistiigi/binfmt:latest | ||
platforms: all | ||
|
||
- name: Setup Docker buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GH_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: metadata | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
flavor: | | ||
latest=${{ startsWith(github.ref, 'refs/heads/main') }} | ||
suffix=-${{ github.sha }} | ||
- name: Build and push Docker image | ||
id: build | ||
uses: docker/build-push-action@v5 | ||
with: | ||
build-args: GH_TOKEN=${{ secrets.GH_TOKEN }} | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64,linux/arm64/v8 | ||
cache-to: type=gha,mode=max,ignore-error=true | ||
cache-from: type=gha | ||
push: true | ||
tags: ${{ steps.metadata.outputs.tags }} | ||
labels: ${{ steps.metadata.outputs.labels }} |
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 |
---|---|---|
|
@@ -37,4 +37,6 @@ out/ | |
|
||
### Project ### | ||
.env | ||
configuration.toml | ||
persistence/ | ||
configuration.toml | ||
.db |
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,49 @@ | ||
{ | ||
"branches": [ | ||
"main", | ||
{ | ||
"name": "dev", | ||
"prerelease": true | ||
} | ||
], | ||
"plugins": [ | ||
[ | ||
"@semantic-release/commit-analyzer", { | ||
"releaseRules": [ | ||
{ "type": "build", "scope": "Needs bump", "release": "patch" } | ||
] | ||
} | ||
], | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/changelog", | ||
"gradle-semantic-release-plugin", | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": [ | ||
"README.md", | ||
"CHANGELOG.md", | ||
"gradle.properties", | ||
] | ||
} | ||
], | ||
[ | ||
"@semantic-release/github", | ||
{ | ||
"assets": [ | ||
{ | ||
"path": "build/libs/*.jar" | ||
} | ||
], | ||
successComment: false | ||
} | ||
], | ||
[ | ||
"@saithodev/semantic-release-backmerge", | ||
{ | ||
backmergeBranches: [{"from": "main", "to": "dev"}], | ||
clearWorkspace: true | ||
} | ||
] | ||
] | ||
} |
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,31 @@ | ||
FROM azul/zulu-openjdk:latest | ||
|
||
ARG CONFIG_FILE_PATH | ||
|
||
ARG DB_URL | ||
ARG DB_USER | ||
ARG DB_PASSWORD | ||
|
||
ARG JWT_SECRET | ||
ARG JWT_ISSUER | ||
ARG JWT_VALIDITY_IN_MIN | ||
|
||
ARG BASIC_USERNAME | ||
ARG BASIC_PASSWORD | ||
|
||
ENV CONFIG_FILE_PATH $CONFIG_FILE_PATH | ||
|
||
ENV DB_URL $DB_URL | ||
ENV DB_USER $DB_USER | ||
ENV DB_PASSWORD $DB_PASSWORD | ||
|
||
ENV JWT_SECRET $JWT_SECRET | ||
ENV JWT_ISSUER $JWT_ISSUER | ||
ENV JWT_VALIDITY_IN_MIN $JWT_VALIDITY_IN_MIN | ||
|
||
ENV BASIC_USERNAME $BASIC_USERNAME | ||
ENV BASIC_PASSWORD $BASIC_PASSWORD | ||
|
||
COPY build/libs/revanced-api-*.jar revanced-api.jar | ||
|
||
CMD java -jar revanced-api.jar start |
Oops, something went wrong.