Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt

name: ci
# run-name is evaluated before any job runs, so it cannot read needs.route.outputs.
# It re-derives the channel from the github context instead.
run-name: "ci: ${{ (github.event_name == 'push' && github.ref_type == 'tag') && (contains(github.ref_name, '-') && 'prerelease' || 'release') || 'main' }} ${{ github.ref_name }}"
on:
workflow_dispatch: {}
push:
branches:
- master
tags:
- v*.*.*
- v*.*.*-**

jobs:
route:
name: route
if: ${{ !github.event.repository.fork }}
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
target: ${{ steps.route.outputs.target }}
steps:
- name: Checkout Repo
if: github.event_name == 'push' && github.ref_type == 'branch'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 2
persist-credentials: false
- name: Detect non-docs changes
id: changes
if: github.event_name == 'push' && github.ref_type == 'branch'
uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
with:
base: ${{ github.ref_name }}
filters: |
code:
- '!**/*.md'
- name: Route
id: route
env:
EVENT_NAME: ${{ github.event_name }}
REF_TYPE: ${{ github.ref_type }}
REF_NAME: ${{ github.ref_name }}
CODE_CHANGED: ${{ steps.changes.outputs.code }}
run: |
set -euo pipefail
if [[ "${EVENT_NAME}" == "pull_request" ]]; then
# Preserves testMasterAndReleaseWorkflows, which runs all three flows on PRs.
target=all
elif [[ "${EVENT_NAME}" == "push" && "${REF_TYPE}" == "tag" ]]; then
if [[ "${REF_NAME}" == *-* ]]; then
target=prerelease
else
target=release
fi
elif [[ "${EVENT_NAME}" == "push" && "${CODE_CHANGED}" != "true" ]]; then
target=skip
else
target=main
fi
echo "Routing ${EVENT_NAME} ${REF_TYPE} ${REF_NAME} to ${target}"
echo "target=${target}" >> "$GITHUB_OUTPUT"

main:
name: main
needs: route
if: needs.route.outputs.target == 'main' || needs.route.outputs.target == 'all'
permissions:
contents: write
pull-requests: write
id-token: write
uses: ./.github/workflows/master.yml
secrets: inherit

prerelease:
name: prerelease
needs: route
if: needs.route.outputs.target == 'prerelease' || needs.route.outputs.target == 'all'
permissions:
contents: write
pull-requests: write
id-token: write
uses: ./.github/workflows/prerelease.yml
secrets: inherit

release:
name: release
needs: route
if: needs.route.outputs.target == 'release' || needs.route.outputs.target == 'all'
permissions:
contents: write
pull-requests: write
id-token: write
uses: ./.github/workflows/release.yml
secrets: inherit
14 changes: 4 additions & 10 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:

jobs:
prerequisites:
if: github.repository == 'pulumi/pulumi-splunk'
permissions:
contents: read
pull-requests: write
Expand Down Expand Up @@ -73,10 +74,12 @@ jobs:
version: ${{ needs.prerequisites.outputs.version }}

lint:
if: github.repository == 'pulumi/pulumi-splunk'
name: lint
uses: ./.github/workflows/lint.yml
secrets: inherit
license_check:
if: github.repository == 'pulumi/pulumi-splunk'
name: License Check
uses: ./.github/workflows/license.yml
secrets: inherit
Expand Down Expand Up @@ -154,13 +157,4 @@ jobs:

name: master
on:
workflow_dispatch: {}
push:
branches:
- master
paths-ignore:
- "**.md"
tags-ignore:
- v*
- sdk/*
- "**"
workflow_call: {}
7 changes: 4 additions & 3 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ env:

jobs:
prerequisites:
if: github.repository == 'pulumi/pulumi-splunk'
permissions:
contents: read
pull-requests: write
Expand Down Expand Up @@ -46,10 +47,12 @@ jobs:
version: ${{ needs.prerequisites.outputs.version }}

lint:
if: github.repository == 'pulumi/pulumi-splunk'
name: lint
uses: ./.github/workflows/lint.yml
secrets: inherit
license_check:
if: github.repository == 'pulumi/pulumi-splunk'
name: License Check
uses: ./.github/workflows/license.yml
secrets: inherit
Expand Down Expand Up @@ -87,6 +90,4 @@ jobs:

name: prerelease
on:
push:
tags:
- v*.*.*-**
workflow_call: {}
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt
name: release
on:
push:
tags:
- v*.*.*
- "!v*.*.*-**"
workflow_call: {}

env:
PULUMI_API: https://api.pulumi-staging.io
Expand All @@ -18,6 +15,7 @@ env:

jobs:
prerequisites:
if: github.repository == 'pulumi/pulumi-splunk'
permissions:
contents: read
pull-requests: write
Expand Down Expand Up @@ -51,10 +49,12 @@ jobs:
version: ${{ needs.prerequisites.outputs.version }}

lint:
if: github.repository == 'pulumi/pulumi-splunk'
name: lint
uses: ./.github/workflows/lint.yml
secrets: inherit
license_check:
if: github.repository == 'pulumi/pulumi-splunk'
name: License Check
uses: ./.github/workflows/license.yml
secrets: inherit
Expand Down
Loading