-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 changed file
with
89 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,89 @@ | ||
name: Release Forge | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
permissions: | ||
id-token: write | ||
contents: write | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: gradle/wrapper-validation-action@v1 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
- run: chmod +x ./gradlew | ||
- name: Enable daemon | ||
run: sed -i -e 's/org.gradle.daemon=false/org.gradle.daemon=true/' gradle.properties | ||
- name: Compile | ||
run: ./gradlew testClasses | ||
- name: JUnit | ||
run: ./gradlew test | ||
- uses: google-github-actions/auth@v1 | ||
with: | ||
workload_identity_provider: ${{secrets.GCP_IDENTITY_PROVIDER}} | ||
service_account: ${{secrets.GCP_SERVICE_ACCOUNT}} | ||
- name: Download Private Key | ||
run: gcloud storage cp gs://kotori316-resources/secring.gpg "${HOME}/secring.gpg" | ||
- name: Download JKS | ||
run: gcloud storage cp gs://kotori316-resources/kotori316_keystore.jks "${HOME}/kotori316_keystore.jks" | ||
- name: Download Public Key | ||
run: | | ||
gcloud storage cp gs://kotori316-resources/pgp_public.pub "${HOME}/pgp_public.pub" | ||
gpg --import "${HOME}/pgp_public.pub" | ||
- name: Get credentials | ||
id: get-secrets | ||
uses: google-github-actions/get-secretmanager-secrets@v1 | ||
with: | ||
secrets: |- | ||
key_id:kotori316-mods-resources/signing-key-id | ||
key_password:kotori316-mods-resources/signing-password | ||
jar_password:kotori316-mods-resources/jar-sign-key-password | ||
modrinth_token:kotori316-mods-resources/modrinth_token | ||
curseforge_token:kotori316-mods-resources/curseforge_token | ||
azure_token:kotori316-mods-resources/azure_token | ||
- name: Release | ||
run: >- | ||
./gradlew | ||
-Psigning.secretKeyRingFile="${HOME}/secring.gpg" | ||
-Psigning.password="${KEY_PASSWORD}" | ||
-Psigning.keyId="${KEY_ID}" | ||
-PjarSign.keyLocation="${HOME}/kotori316_keystore.jks" | ||
-PjarSign.keyAlias="ko316" | ||
-PjarSign.storePass="${JAR_PASSWORD}" | ||
build publishToMavenLocal curseforge modrinth githubRelease publish -x test | ||
env: | ||
REPO_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
AZURE_TOKEN: ${{steps.get-secrets.outputs.azure_token}} | ||
KEY_PASSWORD: ${{steps.get-secrets.outputs.key_password}} | ||
KEY_ID: ${{steps.get-secrets.outputs.key_id}} | ||
JAR_PASSWORD: ${{steps.get-secrets.outputs.jar_password}} | ||
CURSE_TOKEN: ${{steps.get-secrets.outputs.curseforge_token}} | ||
MODRINTH_TOKEN: ${{steps.get-secrets.outputs.modrinth_token}} | ||
- name: Verify Build Files | ||
run: | | ||
for f in $(find ./ -name "*.asc") ; do | ||
echo "${f:0:-4}" | ||
gpg --verify "$f" "${f:0:-4}" | ||
done | ||
- name: Verify Main Jar | ||
run: jarsigner -verify -keystore "${HOME}/kotori316_keystore.jks" "$(ls build/libs/*.jar | grep -v "deobf" | grep -v "sources")" -strict | ||
- name: Verify Maven Local | ||
run: | | ||
for f in $(find ~/.m2 -name "*.asc") ; do | ||
echo "${f:0:-4}" | ||
gpg --verify "$f" "${f:0:-4}" | ||
done | ||
- name: Upload Artifacts | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: SLP-Release-${{ github.run_number }} | ||
path: | | ||
build/libs/ |