useless build-step removed. #334
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: CI | |
| on: | |
| push: | |
| branches: [ master ] | |
| paths-ignore: | |
| - '**/README.md' | |
| - '**/.gitignore' | |
| - '.run/**' | |
| tags: | |
| - "[0-9]+.[0-9]+.[0-9]+" | |
| jobs: | |
| build: | |
| name: Build Gradle Plugin | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: 🚚 Get latest code | |
| uses: actions/checkout@v4 | |
| # https://github.com/actions/setup-java | |
| - name: ☕ Setup JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| architecture: x64 | |
| distribution: corretto | |
| java-version: '17' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| gradle-version: '9.0.0' | |
| build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" | |
| build-scan-terms-of-use-agree: "yes" | |
| build-scan-publish: false | |
| - name: Gradle Build | |
| env: | |
| GITHUB_ACTOR: ${{ GITHUB.REPOSITORY_OWNER }} | |
| GITHUB_TOKEN: ${{ SECRETS.GITHUB_TOKEN }} | |
| URL: "https://maven.pkg.github.com/syslogic/agconnect-publishing-gradle-plugin/io/syslogic/agconnect-publishing-gradle-plugin/1.4.2/agconnect-publishing-gradle-plugin-1.4.2.jar" | |
| run: | | |
| mkdir build | |
| chmod +x ./gradlew | |
| gradle --no-daemon -Pversion=${{ github.event.push.tag_name }} :build | |
| cd ./build/libs | |
| ls -la | grep jar | |
| if wget --user ${{ env.GITHUB_ACTOR }} --password ${{ env.GITHUB_TOKEN }} -q --method=HEAD ${{ env.URL }}; then | |
| echo "PUBLISHED=true" >> "$GITHUB_ENV" | |
| echo "::notice::URL exists" | |
| else | |
| echo "PUBLISHED=false" >> "$GITHUB_ENV" | |
| echo "::notice::URL does not exist" | |
| fi | |
| - name: Gradle Publish | |
| if: ${{ env.PUBLISHED == 'false' }} | |
| env: | |
| GITHUB_ACTOR: ${{ GITHUB.REPOSITORY_OWNER }} | |
| GITHUB_TOKEN: ${{ SECRETS.GITHUB_TOKEN }} | |
| run: | | |
| gradle --no-daemon -Pversion=${{ github.event.push.tag_name }} :publishGPRPublicationToGitHubPackagesRepository | |
| - name: 📦 Retain Artifact (JAR) | |
| id: retain-plugin-jar | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: agconnect-publishing-gradle-plugin | |
| path: ./build/libs/*.jar | |
| retention-days: 14 |