Update for 2023 #67
Workflow file for this run
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
# This workflow will build a Java project with Gradle | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | |
name: Java CI with Gradle | |
on: | |
push: | |
branches: [ main] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ windows-latest, macos-latest, ubuntu-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Download Webots | |
id: cache-webots-download | |
uses: DeepBlueRobotics/setup-webots@versioning-and-caching | |
with: | |
webotsVersion: R2023b | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Build | |
run: | | |
./gradlew build --info --stacktrace | |
shell: bash | |
release: | |
# Only release from the main branch | |
if: github.ref == 'refs/heads/main' | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Compute next semantic version | |
id: version | |
uses: paulhatch/semantic-version@v5 | |
with: | |
branch: "main" | |
- name: Tag | |
run: git tag ${{ steps.version.outputs.version_tag }} | |
- name: Push | |
run: git push origin ${{ steps.version.outputs.version_tag }} | |
- name: Publish to Gradle Plugin Portal | |
env: | |
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }} | |
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }} | |
run: ./gradlew :plugin:publishPlugins -Pversion=${{ steps.version.outputs.version }} -Pgradle.publish.key=$GRADLE_PUBLISH_KEY -Pgradle.publish.secret=$GRADLE_PUBLISH_SECRET --info --stacktrace | |
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in | |
# the publishing section of your build.gradle | |
- name: Publish to GitHub Packages | |
run: ./gradlew -p plugin -Pversion=${{ steps.version.outputs.version }} publish | |
env: | |
GITHUB_ACTOR: ${{ github.actor }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |