diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a06c6e1..8c7c4ea 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,8 +37,7 @@ jobs: - name: Gradle Wrapper Validation uses: gradle/actions/wrapper-validation@v3 - - - name: Test on Ubuntu + - name: Run Checks run: ./gradlew assemble check --no-build-cache --no-daemon --stacktrace # Deploy to Github Pages @@ -47,8 +46,6 @@ jobs: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest - needs: - - test-ubuntu if: github.repository == 'square/invert' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' steps: - name: Checkout @@ -72,16 +69,24 @@ jobs: uses: actions/upload-pages-artifact@v2 with: # Upload the generated pages -# path: './examples/build/reports/invert' path: './build/static' - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v2 + publish-check: + # needs: + # - test-ubuntu + runs-on: ubuntu-latest + if: github.repository == 'square/invert' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + steps: + - name: Set up environment variable + run: echo "VERSION_NAME=$(cat gradle.properties | grep "^version=" | awk -F'=' '{print $2}')" >> $GITHUB_ENV + publish-snapshot: needs: - - test-ubuntu + - publish-check runs-on: ubuntu-latest if: github.repository == 'square/invert' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' timeout-minutes: 25 @@ -110,13 +115,11 @@ jobs: ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} - publish-release: -# Temporary to help debug publishing of 0.0.1-dev -# needs: -# - test-ubuntu + needs: + - publish-check runs-on: ubuntu-latest - if: github.repository == 'square/invert' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + if: success() && !endsWith(env.VERSION_NAME, '-SNAPSHOT') timeout-minutes: 25 steps: @@ -133,9 +136,6 @@ jobs: - name: Gradle Wrapper Validation uses: gradle/actions/wrapper-validation@v3 - - name: Retrieve Version from gradle.properties - run: echo "VERSION_NAME=$(cat gradle.properties | grep "^version=" | awk -F'=' '{print $2}')" >> $GITHUB_ENV - - name: Publish release (main only) run: ./gradlew publishToMavenCentral --no-configuration-cache --stacktrace --no-parallel if: success() && !endsWith(env.VERSION_NAME, '-SNAPSHOT')