aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2023-12-08 14:22:52 +0100
committerGitHub <noreply@github.com>2023-12-08 14:22:52 +0100
commit57acdfea63a58203cebda34ef7e16ed6fcc1bf1d (patch)
treeacd9786f82a304a5ecddb36ae6f7f1cdc752a297 /.github
parent247656e0d4cd1733028009cecfab98c26953b795 (diff)
downloadskyhanni-57acdfea63a58203cebda34ef7e16ed6fcc1bf1d.tar.gz
skyhanni-57acdfea63a58203cebda34ef7e16ed6fcc1bf1d.tar.bz2
skyhanni-57acdfea63a58203cebda34ef7e16ed6fcc1bf1d.zip
Add RepoPatterns (#715)
Added RepoPatterns. #715
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/generate-constants.yaml62
1 files changed, 62 insertions, 0 deletions
diff --git a/.github/workflows/generate-constants.yaml b/.github/workflows/generate-constants.yaml
new file mode 100644
index 000000000..c5f667bad
--- /dev/null
+++ b/.github/workflows/generate-constants.yaml
@@ -0,0 +1,62 @@
+# Read the Javadoc of RepoPatternDump for more info
+
+name: RepoPattern
+
+env:
+ data_repo: nea89o/SkyHanni-REPO
+
+on:
+ push:
+ workflow_dispatch:
+
+permissions: { }
+
+jobs:
+ regexes:
+ runs-on: ubuntu-latest
+ name: "Generate regexes"
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up JDK 17
+ uses: actions/setup-java@v3
+ with:
+ java-version: 17
+ distribution: temurin
+ cache: gradle
+ - name: Setup gradle
+ uses: gradle/gradle-build-action@v2
+ - name: Generate Repo Patterns using Gradle
+ run: |
+ ./gradlew generateRepoPatterns --stacktrace
+ - uses: actions/upload-artifact@v3
+ name: Upload generated repo regexes
+ with:
+ name: Repo Regexes
+ path: build/regexes/constants.json
+ publish-regexes:
+ runs-on: ubuntu-latest
+ needs: regexes
+ name: "Publish regexes"
+ if: ${{ 'push' == github.event_name && 'beta' == github.ref_name }}
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ repository: ${{ env.data_repo }}
+ branch: main
+ - uses: actions/download-artifact@v3
+ name: Upload generated repo regexes
+ with:
+ name: Repo Regexes
+ - name: Commit generated regex
+ run: |
+ mkdir -p constants/
+ mv constants.json constants/regexes.json
+ git config user.name 'github-actions[bot]'
+ git config user.email 'github-action@users.noreply.github.com'
+ git add constants/regexes.json
+ git commit -m "Update regexes based on https://github.com/hannibal002/Skyhanni/commit/$GITHUB_SHA"
+ - name: Publish new repository
+ run: |
+ git config --unset-all http.https://github.com/.extraheader
+ git remote add restream https://user:${{secrets.REPO_PAT}}@github.com/${{env.data_repo}}
+ git push restream HEAD:main