diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 497d2e5..5c33c26 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -10,11 +10,15 @@ on: # yamllint disable-line rule:truthy jobs: build: uses: metaborg/actions/.github/workflows/gradle-build-matrix.yaml@main + with: + gradle-command: | + gradle build +# Publish snapshots publish-snapshot: uses: metaborg/actions/.github/workflows/gradle-publish.yaml@main with: gradle-command: | - gradle :publish -Pgitonium.isSnapshot=true + gradle publish -Pgitonium.isSnapshot=true gradle-version-command: | gradle -q :convention-plugin:printVersion -Pgitonium.isSnapshot=true if: "github.event_name == 'push' && github.ref == 'refs/heads/main'" @@ -22,11 +26,12 @@ jobs: secrets: METABORG_ARTIFACTS_USERNAME: ${{ secrets.METABORG_ARTIFACTS_USERNAME }} METABORG_ARTIFACTS_PASSWORD: ${{ secrets.METABORG_ARTIFACTS_PASSWORD }} +# Publish releases publish-release: uses: metaborg/actions/.github/workflows/gradle-publish.yaml@main with: gradle-command: | - gradle :publish + gradle publish gradle-version-command: | gradle -q :convention-plugin:printVersion if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/release-')" @@ -34,4 +39,3 @@ jobs: secrets: METABORG_ARTIFACTS_USERNAME: ${{ secrets.METABORG_ARTIFACTS_USERNAME }} METABORG_ARTIFACTS_PASSWORD: ${{ secrets.METABORG_ARTIFACTS_PASSWORD }} - diff --git a/repo.yaml b/repo.yaml index eadb382..9b41cf5 100644 --- a/repo.yaml +++ b/repo.yaml @@ -35,4 +35,5 @@ developers: files: githubWorkflows: publishRelease: true - publishSnapshot: true \ No newline at end of file + publishSnapshot: true + printVersionTask: ":convention-plugin:printVersion" \ No newline at end of file diff --git a/repoman/src/main/resources/templates/github/workflows/build.yaml.kte b/repoman/src/main/resources/templates/github/workflows/build.yaml.kte index 59229fe..030c5a5 100644 --- a/repoman/src/main/resources/templates/github/workflows/build.yaml.kte +++ b/repoman/src/main/resources/templates/github/workflows/build.yaml.kte @@ -16,7 +16,7 @@ jobs: gradle-command: | gradle ${meta.files.githubWorkflows.buildTask} @if(meta.files.githubWorkflows.publishSnapshot) - +# Publish snapshots publish-snapshot: uses: metaborg/actions/.github/workflows/gradle-publish.yaml@main with: @@ -27,13 +27,11 @@ jobs: if: "github.event_name == 'push' && github.ref == 'refs/heads/${meta.mainBranch}'" needs: [build] secrets: - @raw - METABORG_ARTIFACTS_USERNAME: ${{ secrets.METABORG_ARTIFACTS_USERNAME }} - METABORG_ARTIFACTS_PASSWORD: ${{ secrets.METABORG_ARTIFACTS_PASSWORD }} - @endraw + METABORG_ARTIFACTS_USERNAME: ${'$'}{{ secrets.METABORG_ARTIFACTS_USERNAME }} + METABORG_ARTIFACTS_PASSWORD: ${'$'}{{ secrets.METABORG_ARTIFACTS_PASSWORD }} @endif @if(meta.files.githubWorkflows.publishRelease) - +# Publish releases publish-release: uses: metaborg/actions/.github/workflows/gradle-publish.yaml@main with: @@ -44,8 +42,6 @@ jobs: if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/${meta.releaseTagPrefix}')" needs: [build] secrets: - @raw - METABORG_ARTIFACTS_USERNAME: ${{ secrets.METABORG_ARTIFACTS_USERNAME }} - METABORG_ARTIFACTS_PASSWORD: ${{ secrets.METABORG_ARTIFACTS_PASSWORD }} - @endraw + METABORG_ARTIFACTS_USERNAME: ${'$'}{{ secrets.METABORG_ARTIFACTS_USERNAME }} + METABORG_ARTIFACTS_PASSWORD: ${'$'}{{ secrets.METABORG_ARTIFACTS_PASSWORD }} @endif \ No newline at end of file