aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-12-23 00:25:46 +0100
committerLinnea Gräf <nea@nea.moe>2024-12-23 00:51:12 +0100
commit6b7f5b95b0541eb0e76855152e283e5f9cad0c3c (patch)
treebd23945242e5e9edcbabc5cbddcc37dd63d87a39 /.github/workflows
parent2cd351d816b7dad8c3251fcd640ff697335598a6 (diff)
downloadLocalTransactionLedger-6b7f5b95b0541eb0e76855152e283e5f9cad0c3c.tar.gz
LocalTransactionLedger-6b7f5b95b0541eb0e76855152e283e5f9cad0c3c.tar.bz2
LocalTransactionLedger-6b7f5b95b0541eb0e76855152e283e5f9cad0c3c.zip
ci: Create nightly GitHub release
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build.yml70
1 files changed, 49 insertions, 21 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index e1e773f..71a5e94 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -1,29 +1,57 @@
name: Run Gradle Build
on:
- - push
- - pull_request
+ - push
+ - pull_request
jobs:
- gradle:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout source
- uses: actions/checkout@v4.1.1
+ gradle:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout source
+ uses: actions/checkout@v4.1.1
- - name: Setup Java
- uses: actions/setup-java@v4.0.0
- with:
- distribution: temurin
- java-version: 17
+ - name: Setup Java
+ uses: actions/setup-java@v4.0.0
+ with:
+ distribution: temurin
+ java-version: 17
- - name: Setup Gradle
- uses: gradle/actions/setup-gradle@v3
+ - name: Setup Gradle
+ uses: gradle/actions/setup-gradle@v3
- - name: Execute Gradle build
- run: ./gradlew build
+ - name: Execute Gradle build
+ run: ./gradlew build
- - name: Upload built mod JAR
- uses: actions/upload-artifact@v4.3.0
- with:
- name: mod-jar
- path: build/libs/*.jar
+ - name: Upload built mod JAR
+ uses: actions/upload-artifact@v4.3.0
+ with:
+ name: mod-jar
+ path: build/libs/*.jar
+ release:
+ runs-on: ubuntu-latest
+ needs: gradle
+ permissions: write-all
+ if: ${{ 'push' == github.event_name && 'master' == github.ref_name && '758196864' == github.repository_id }}
+ steps:
+ - name: Set repository context
+ uses: actions/checkout@v4
+ - name: Download artifact
+ uses: actions/download-artifact@v4
+ with:
+ name: mod-jar
+ - name: Update release
+ run: |
+ echo Deleting all existing nightly assets
+ gh release view nightly --json assets \
+ | jq '.assets[]|.name' -r \
+ | while IFS= read -r name;
+ do
+ gh release delete-asset -y -- nightly "$name";
+ done
+ echo Pushing current commit to nightly ref
+ git tag -f nightly
+ git push -f origin nightly
+ echo Upload release
+ gh release upload nightly -- "$(echo *.jar)"
+ env:
+ GH_TOKEN: ${{ github.token }} \ No newline at end of file