From 41262d11c57422504d189518ef0861fb0036a410 Mon Sep 17 00:00:00 2001 From: Carlos Ortiz Date: Thu, 5 Sep 2024 22:53:42 -0600 Subject: [PATCH] Add GitHub Actions workflows for stable and beta deployments Introduces deploy-stable.yml for stable releases triggered by tags starting with 'v*' and deploy-beta.yml for beta releases triggered by tags ending in '-beta'. Both workflows set up JDK 17, cache Gradle packages, and run build, test, and publish steps. This ensures efficient CI/CD for different release channels. --- .github/workflows/deploy-beta.yml | 42 +++++++++++++++++++++++++++++ .github/workflows/deploy-stable.yml | 42 +++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 .github/workflows/deploy-beta.yml create mode 100644 .github/workflows/deploy-stable.yml diff --git a/.github/workflows/deploy-beta.yml b/.github/workflows/deploy-beta.yml new file mode 100644 index 0000000..5c07282 --- /dev/null +++ b/.github/workflows/deploy-beta.yml @@ -0,0 +1,42 @@ +name: Test and Publish + +on: + push: + tags: + - '*-beta' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + + - name: Cache Gradle packages + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Publish Plugin + run: ./gradlew build test publishPlugin + env: + CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }} + PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} + PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }} + PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} + CHANNEL: beta diff --git a/.github/workflows/deploy-stable.yml b/.github/workflows/deploy-stable.yml new file mode 100644 index 0000000..76dfca4 --- /dev/null +++ b/.github/workflows/deploy-stable.yml @@ -0,0 +1,42 @@ +name: Test and Publish + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + + - name: Cache Gradle packages + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Publish Plugin + run: ./gradlew build test publishPlugin + env: + CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }} + PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} + PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }} + PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} + CHANNEL: stable