From f10026a4c19e7e475fcb1b9f7bcb715c58428243 Mon Sep 17 00:00:00 2001 From: ajgeiss0702 Date: Sat, 6 Aug 2022 13:47:19 -0700 Subject: [PATCH] automatic polymart release --- .github/workflows/release.yml | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ee2c511 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: Deploy Release to Polymart + +on: + push: + branches: + - master + + +jobs: + build: + runs-on: ubuntu-latest + environment: polymart_deploy + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'temurin' + - name: Build with Gradle + uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 + with: + arguments: :free:shadowJar :premium:shadowJar + - name: Upload build files artifact + uses: actions/upload-artifact@v2.3.1 + with: + # Artifact name + name: build-files + # A file, directory or wildcard pattern that describes what to upload + path: '*/build/*' + # The desired behavior if no files are found using the provided path. + if-no-files-found: error + retention-days: 2 + - name: Download changelogs + run: | + curl "https://ajg0702.us/pl/updater/changelogs.php?project=${{ github.repository }}" > changelogs.bb + - name: Deploy to Polymart + env: + POLYMART_TOKEN: ${{ secrets.POLYMART_TOKEN }} + run: | + export VERSION=`cat build.gradle.kts | grep "version " | awk -F'"' '{print $2}'` + file free/build/libs/ajQueue-$VERSION.jar + curl -F "file=@free/build/libs/ajQueue-$VERSION.jar" -F api_key=$POLYMART_TOKEN -F resource_id="2535" -F version="$VERSION" -F title="v$VERSION" -F message="$(cat changelogs.bb)" "https://api.polymart.org/v1/postUpdate"