Add Cooldowns component for player cooldowns #10
This file contains hidden or 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: Deploy to Negative Games Nexus (Gradle) | |
| on: | |
| push: | |
| branches: | |
| - release | |
| - snapshot | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v3 | |
| - name: Configure Gradle / Nexus credentials | |
| run: | | |
| mkdir -p ~/.gradle | |
| cat << 'EOF' > ~/.gradle/gradle.properties | |
| nexusUsername=${{ secrets.NEXUS_USERNAME }} | |
| nexusPassword=${{ secrets.NEXUS_PASSWORD }} | |
| nexusSnapshotsUrl=https://repo.negative.games/repository/maven-snapshots | |
| nexusReleasesUrl=https://repo.negative.games/repository/maven-releases | |
| EOF | |
| # Modify version for release branch (remove -SNAPSHOT) | |
| - name: Modify version for release | |
| if: github.ref == 'refs/heads/release' | |
| run: | | |
| find . -name "build.gradle.kts" -type f -exec sed -i "s/\\(var apiVersion = \\\"[^\\\"]*\\)-SNAPSHOT\\\"/\\1\\\"/" {} + | |
| # Modify version for snapshot branch (add -SNAPSHOT if not present) | |
| - name: Modify version for snapshot | |
| if: github.ref == 'refs/heads/snapshot' | |
| run: | | |
| find . -name "build.gradle.kts" -type f -exec sed -i "/var apiVersion = \\\".*-SNAPSHOT\\\"/! s/\\(var apiVersion = \\\"[^\\\"]*\\)\\\"/\\1-SNAPSHOT\\\"/" {} + | |
| # Make gradlew executable | |
| - name: Make gradlew executable | |
| run: chmod +x ./gradlew | |
| # Deploy to RELEASES on release branch | |
| - name: Build and deploy release | |
| if: github.ref == 'refs/heads/release' | |
| run: ./gradlew clean publish -PisRelease=true | |
| # Deploy to SNAPSHOTS on snapshot branch | |
| - name: Build and deploy snapshot | |
| if: github.ref == 'refs/heads/snapshot' | |
| run: ./gradlew clean publish -PisRelease=false |