Fix version check #7
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
--- | |
name: Build 1.20 Dev | |
on: | |
push: | |
branches: | |
- "1.20-dev" | |
pull_request: | |
branches: | |
- "1.20-dev" | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Notify Discord of Run Start | |
if: github.event_name != 'pull_request' | |
uses: Ilshidur/action-discord@0.3.2 | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
DISCORD_EMBEDS: '[{"title":"STARTED","color":3224808,"fields":[{"name":"Project","value":"${{github.event.repository.name}}"},{"name":"Action","value":"Build"},{"name":"Branch","value":"${{github.ref_name}}","inline":true},{"name":"Run","value":"${{github.run_number}}","inline":true}]}]' | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: "17" | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Build Project | |
uses: gradle/gradle-build-action@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
gradle-version: wrapper | |
arguments: build sonar --info | |
- name: Notify Discord of Succeeded Build | |
if: (github.event_name != 'pull_request') && success() | |
uses: Ilshidur/action-discord@0.3.2 | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
DISCORD_EMBEDS: '[{"title":"SUCCESS","color":3470945,"fields":[{"name":"Project","value":"${{github.event.repository.name}}"},{"name":"Action","value":"Build"},{"name":"Branch","value":"${{github.ref_name}}","inline":true},{"name":"Run","value":"${{github.run_number}}","inline":true}]}]' | |
- name: Notify Discord of Failed Build | |
if: (github.event_name != 'pull_request') && failure() | |
uses: Ilshidur/action-discord@0.3.2 | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
DISCORD_EMBEDS: '[{"title":"FAILED","color":16071463,"fields":[{"name":"Project","value":"${{github.event.repository.name}}"},{"name":"Action","value":"Build"},{"name":"Branch","value":"${{github.ref_name}}","inline":true},{"name":"Run","value":"${{github.run_number}}","inline":true}]}]' | |
deploy: | |
name: Deploy Project | |
runs-on: ubuntu-latest | |
needs: build | |
if: (github.event_name != 'pull_request' && github.ref_name == '1.20-dev') | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Notify Discord of Deploy | |
uses: Ilshidur/action-discord@0.3.2 | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
DISCORD_EMBEDS: '[{"title":"STARTED","color":3224808,"fields":[{"name":"Project","value":"${{github.event.repository.name}}"},{"name":"Action","value":"Deploy"},{"name":"Branch","value":"${{github.ref_name}}","inline":true},{"name":"Run","value":"${{github.run_number}}","inline":true}]}]' | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: "17" | |
- name: Deploy to CloudSmith | |
env: | |
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-version: wrapper | |
arguments: publish | |
- name: Notify Discord of Succeeded Deploy | |
if: success() | |
uses: Ilshidur/action-discord@0.3.2 | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
DISCORD_EMBEDS: '[{"title":"SUCCESS","color":3470945,"fields":[{"name":"Project","value":"${{github.event.repository.name}}"},{"name":"Action","value":"Deploy"},{"name":"Branch","value":"${{github.ref_name}}","inline":true},{"name":"Run","value":"${{github.run_number}}","inline":true}]}]' | |
- name: Notify Discord of Failed Deploy | |
if: failure() | |
uses: Ilshidur/action-discord@0.3.2 | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
DISCORD_EMBEDS: '[{"title":"FAILED","color":16071463,"fields":[{"name":"Project","value":"${{github.event.repository.name}}"},{"name":"Action","value":"Deploy"},{"name":"Branch","value":"${{github.ref_name}}","inline":true},{"name":"Run","value":"${{github.run_number}}","inline":true}]}]' |