diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 000000000..308d35ac0 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,39 @@ +name: Nightly + +on: + schedule: + - cron: "10 0 * * *" + workflow_dispatch: + +permissions: + contents: read + actions: write + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 100 + - uses: actions/setup-node@v7 + with: + node-version: 'lts/*' + + - run: npm run nightly-check -- --platform web --force false + id: web + - run: npm run nightly-check -- --platform dotnet --force false + id: dotnet + - run: npm run nightly-check -- --platform kotlin --force false + id: kotlin + + # Runs dispatched via GITHUB_TOKEN are an exception to the no-recursive-runs rule, so no PAT is needed. + - if: steps.web.outputs.has_changes == 'true' || steps.dotnet.outputs.has_changes == 'true' || steps.kotlin.outputs.has_changes == 'true' + run: > + gh workflow run publish.yml + --ref ${{ github.ref_name }} + -f web=${{ steps.web.outputs.has_changes }} + -f dotnet=${{ steps.dotnet.outputs.has_changes }} + -f kotlin=${{ steps.kotlin.outputs.has_changes }} + env: + GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 80fd9f99b..a53f3f227 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,10 +1,24 @@ name: Publish on: - schedule: - - cron: "10 0 * * *" workflow_dispatch: inputs: + web: + type: boolean + description: Publish web packages + default: true + dotnet: + type: boolean + description: Publish .NET packages + default: true + kotlin: + type: boolean + description: Publish Kotlin packages + default: true + force: + type: boolean + description: Publish all web packages, not only the ones changed in the last 26 hours + default: false dry_run: type: boolean description: Build and verify all packages without publishing them @@ -12,29 +26,32 @@ on: jobs: web: + if: inputs.web uses: ./.github/workflows/~publish_web.yml permissions: contents: read id-token: write secrets: inherit - with: + with: version: alpha ${{github.run_number}} npm_tag: alpha - force: ${{ inputs.dry_run == true }} - dry_run: ${{ inputs.dry_run == true }} + force: ${{ inputs.force || inputs.dry_run }} + dry_run: ${{ inputs.dry_run }} dotnet: + if: inputs.dotnet uses: ./.github/workflows/~publish_dotnet.yml secrets: inherit - with: + with: version: alpha ${{github.run_number}} - force: ${{ inputs.dry_run == true }} - dry_run: ${{ inputs.dry_run == true }} + force: ${{ inputs.force || inputs.dry_run }} + dry_run: ${{ inputs.dry_run }} kotlin: + if: inputs.kotlin uses: ./.github/workflows/~publish_kotlin.yml secrets: inherit - with: + with: version: alpha ${{github.run_number}} - force: ${{ inputs.dry_run == true }} - dry_run: ${{ inputs.dry_run == true }} \ No newline at end of file + force: ${{ inputs.force || inputs.dry_run }} + dry_run: ${{ inputs.dry_run }} diff --git a/.github/workflows/~publish_dotnet.yml b/.github/workflows/~publish_dotnet.yml index 59f69d64f..00b85a51d 100644 --- a/.github/workflows/~publish_dotnet.yml +++ b/.github/workflows/~publish_dotnet.yml @@ -12,24 +12,7 @@ on: default: false jobs: - check: - runs-on: ubuntu-latest - outputs: - has_changes: ${{ steps.check.outputs.has_changes }} - steps: - - uses: actions/checkout@v7 - with: - fetch-depth: 100 - - uses: actions/setup-node@v7 - with: - node-version: 'lts/*' - cache: 'npm' - - run: npm run nightly-check -- --platform dotnet --force ${{ inputs.force }} - id: check - build: - needs: check - if: needs.check.outputs.has_changes == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/~publish_kotlin.yml b/.github/workflows/~publish_kotlin.yml index b3ed784e9..bc8e92812 100644 --- a/.github/workflows/~publish_kotlin.yml +++ b/.github/workflows/~publish_kotlin.yml @@ -12,24 +12,7 @@ on: default: false jobs: - check: - runs-on: ubuntu-latest - outputs: - has_changes: ${{ steps.check.outputs.has_changes }} - steps: - - uses: actions/checkout@v7 - with: - fetch-depth: 100 - - uses: actions/setup-node@v7 - with: - node-version: 'lts/*' - cache: 'npm' - - run: npm run nightly-check -- --platform kotlin --force ${{ inputs.force }} - id: check - build: - needs: check - if: needs.check.outputs.has_changes == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/~publish_web.yml b/.github/workflows/~publish_web.yml index c52fc40b7..084937332 100644 --- a/.github/workflows/~publish_web.yml +++ b/.github/workflows/~publish_web.yml @@ -19,24 +19,7 @@ on: jobs: - check: - runs-on: ubuntu-latest - outputs: - has_changes: ${{ steps.check.outputs.has_changes }} - steps: - - uses: actions/checkout@v7 - with: - fetch-depth: 100 - - uses: actions/setup-node@v7 - with: - node-version: 'lts/*' - cache: 'npm' - - run: npm run nightly-check -- --platform web --force ${{ inputs.force }} - id: check - build: - needs: check - if: needs.check.outputs.has_changes == 'true' runs-on: ubuntu-latest permissions: contents: read