From f6e6cc56d4c37703aeaf036a68dff4e9bb71a60f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Peignier?= Date: Mon, 17 Oct 2022 20:00:42 -0700 Subject: [PATCH] Add CI --- .github/dependabot.yml | 6 ++++++ .github/workflows/gradle.yml | 15 +++++++++++++++ .github/workflows/publish.yml | 23 +++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/gradle.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..e075815 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "gradle" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..23d0960 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,15 @@ +name: CI +on: [ push ] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '11' + cache: 'gradle' + - name: Build with Gradle + run: ./gradlew build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..bb2e04f --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,23 @@ +name: Publish +on: + release: + types: [ published ] +jobs: + publish-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '11' + cache: 'gradle' + - name: Publish artifact + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # The GITHUB_REF tag comes in the format 'refs/tags/xxx'. + # So if we split on '/' and take the 3rd value, we can get the release name. + run: | + NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3) + ./gradlew -Pversion=${NEW_VERSION} publish