diff --git a/.github/workflows/command-dispatch.yml b/.github/workflows/command-dispatch.yml deleted file mode 100644 index f6bf7a9a54f9..000000000000 --- a/.github/workflows/command-dispatch.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Command Dispatch for PR events -on: - issue_comment: - types: [created] - -jobs: - command-dispatch: - runs-on: ubuntu-latest - steps: - - name: Dispatch command - uses: peter-evans/slash-command-dispatch@v2 - with: - token: ${{ secrets.PULUMI_BOT_TOKEN }} - reaction-token: ${{ secrets.GITHUB_TOKEN }} - permission: write - issue-type: pull-request - repository: pulumi/pulumi - commands: | - run-acceptance-tests - run-integration-tests - run-docs-gen - run-codegen - auto-rebase diff --git a/.github/workflows/download-pulumi-cron.yml b/.github/workflows/download-pulumi-cron.yml deleted file mode 100644 index ef9f068b4f4d..000000000000 --- a/.github/workflows/download-pulumi-cron.yml +++ /dev/null @@ -1,144 +0,0 @@ -name: Download Pulumi Cron -"on": - workflow_dispatch: {} - schedule: - - cron: 0 8 * * * - -jobs: - macos-homebrew-install: - name: Install Pulumi with Homebrew on macOS - runs-on: macos-latest - steps: - - name: homedate homebrew formulae - run: brew update - - name: homebrew install - run: brew install pulumi - - name: Pulumi Version Details - id: vars - run: | - echo ::set-output name=installed-version::$(pulumi version) - echo ::set-output name=expected-version::v$(curl -sS https://www.pulumi.com/latest-version) - - name: Error if incorrect version found - if: steps.vars.outputs.expected-version != steps.vars.outputs.installed-version - run: | - echo "Expected version ${{ steps.vars.outputs.expected-version }} but found ${{ steps.vars.outputs.installed-version }}" - exit 1 - macOS-direct-install: - name: Install Pulumi via script on macOS - runs-on: macos-latest - steps: - - run: curl -fsSL https://get.pulumi.com | sh - - run: echo "/Users/runner/.pulumi/bin" >> $GITHUB_PATH - - name: Pulumi Version Details - id: vars - run: | - echo ::set-output name=installed-version::$(pulumi version) - echo ::set-output name=expected-version::v$(curl -sS https://www.pulumi.com/latest-version) - - run: which pulumi - - name: Error if incorrect version found - if: steps.vars.outputs.expected-version != steps.vars.outputs.installed-version - run: | - echo "Expected version ${{ steps.vars.outputs.expected-version }} but found ${{ steps.vars.outputs.installed-version }}" - exit 1 - macos-verify-download-link: - name: Verify Direct Download link on macOS - runs-on: macos-latest - steps: - - name: Direct Download - run: curl -L -o pulumi.tar.gz https://get.pulumi.com/releases/sdk/pulumi-v$(curl -sS https://www.pulumi.com/latest-version)-darwin-x64.tar.gz - - run: ls -la - linux-direct-install: - name: Install Pulumi via script on Ubuntu - runs-on: ubuntu-latest - steps: - - name: Remove existing version - run: sudo rm /usr/local/bin/pulumi - - run: curl -fsSL https://get.pulumi.com | sh - - run: echo "/home/runner/.pulumi/bin" >> $GITHUB_PATH - - name: Pulumi Version Details - id: vars - run: | - echo ::set-output name=installed-version::$(pulumi version) - echo ::set-output name=expected-version::v$(curl -sS https://www.pulumi.com/latest-version) - - run: which pulumi - - name: Error if incorrect version found - if: steps.vars.outputs.expected-version != steps.vars.outputs.installed-version - run: | - echo "Expected version ${{ steps.vars.outputs.expected-version }} but found ${{ steps.vars.outputs.installed-version }}" - exit 1 - linux-verify-download-link: - name: Verify Direct Download link on Linux - runs-on: ubuntu-latest - steps: - - name: Direct Download - run: curl -L -o pulumi.tar.gz https://get.pulumi.com/releases/sdk/pulumi-v$(curl -sS https://www.pulumi.com/latest-version)-linux-x64.tar.gz - - run: ls -la - windows-choco-install: - name: Install Pulumi with Chocolatey on Windows - runs-on: windows-latest - steps: - - name: choco install - run: choco upgrade pulumi - - name: Pulumi Version Details - id: vars - shell: bash - run: | - echo ::set-output name=installed-version::$(pulumi version) - echo ::set-output name=expected-version::v$(curl -sS https://www.pulumi.com/latest-version) - - name: Error if incorrect version found - if: steps.vars.outputs.expected-version != steps.vars.outputs.installed-version - run: | - echo "Expected version ${{ steps.vars.outputs.expected-version }} but found ${{ steps.vars.outputs.installed-version }}" - exit 1 - windows-direct-install: - name: Install Pulumi via script on Windows - runs-on: windows-latest - steps: - - run: '[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iex ((New-Object System.Net.WebClient).DownloadString("https://get.pulumi.com/install.ps1")) && SET \"PATH=%PATH%;%USERPROFILE%\.pulumi\bin\"' - shell: pwsh - - run: echo "C:\Users\runneradmin\.pulumi\bin" >> $GITHUB_PATH - shell: bash - - name: Pulumi Version Details - id: vars - shell: bash - run: | - echo ::set-output name=installed-version::$(pulumi version) - echo ::set-output name=expected-version::v$(curl -sS https://www.pulumi.com/latest-version) - - name: Error if incorrect version found - if: steps.vars.outputs.expected-version != steps.vars.outputs.installed-version - run: | - echo "Expected version ${{ steps.vars.outputs.expected-version }} but found ${{ steps.vars.outputs.installed-version }}" - exit 1 - windows-verify-download-link: - name: Verify Direct Download link on Windows - runs-on: windows-latest - steps: - - name: Direct Download - shell: pwsh - run: | - $latestVersion = (Invoke-WebRequest -UseBasicParsing https://www.pulumi.com/latest-version).Content.Trim() - $downloadUrl = "https://get.pulumi.com/releases/sdk/pulumi-v${latestVersion}-windows-x64.zip" - $tempZip = New-Item -Type File (Join-Path $env:TEMP ([System.IO.Path]::ChangeExtension(([System.IO.Path]::GetRandomFileName()), "zip"))) - Invoke-WebRequest https://get.pulumi.com/releases/sdk/pulumi-v${latestVersion}-windows-x64.zip -OutFile $tempZip - - run: ls -la - shell: bash - install-via-gha: - name: Install via GHA on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: ["ubuntu-latest", "windows-latest", "macos-latest"] - steps: - - name: Install Pulumi CLI - uses: pulumi/action-install-pulumi-cli@v1.0.1 - - name: Pulumi Version Details - id: vars - run: | - echo ::set-output name=installed-version::$(pulumi version) - echo ::set-output name=expected-version::v$(curl -sS https://www.pulumi.com/latest-version) - - name: Error if incorrect version found - if: steps.vars.outputs.expected-version != steps.vars.outputs.installed-version - run: | - echo "Expected version ${{ steps.vars.outputs.expected-version }} but found ${{ steps.vars.outputs.installed-version }}" - exit 1 diff --git a/.github/workflows/issue-management.yml b/.github/workflows/issue-management.yml deleted file mode 100644 index 2eaa3a96d1cb..000000000000 --- a/.github/workflows/issue-management.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Issue management - -on: - schedule: - - cron: '12 13 * * *' - -jobs: - stale: - name: Close stale awaiting-feedback issues - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - - steps: - - uses: actions/stale@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - only-labels: awaiting-feedback - stale-issue-message: 'Since we haven''t heard back from you, closing this issue for now. Please feel free to comment with more information and we can get this reopened.' - stale-issue-label: awaiting-feedback-stale - days-before-stale: 14 - close-issue-label: resolution/no-repro - days-before-close: 1 diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 0d645d15bf57..630097dff278 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -1,70 +1,24 @@ on: - workflow_dispatch: {} push: - branches: ["master", "feature/**", "feature-**"] - paths-ignore: - - "CHANGELOG.md" - - "CHANGELOG_PENDING.md" - - "README.md" + branches: ["master"] env: - PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }} + PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PULUMI_TEST_OWNER: "moolumi" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} - PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - TRAVIS_PUBLISH_PACKAGES: true - PYTHON: python - DOTNET_CLI_TELEMETRY_OPTOUT: "true" - DOTNET_ROLL_FORWARD: "Major" jobs: publish-sdks: name: Publish SDKs runs-on: ubuntu-latest - needs: publish-binaries strategy: matrix: - go-version: [1.17.x] - python-version: [3.9.x] - dotnet-version: [6.0.x] node-version: [14.x] - language: ["nodejs", "python", "dotnet"] + language: ["nodejs"] steps: - name: Checkout Repo uses: actions/checkout@v2 - - name: Set up Go ${{ matrix.go-version }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - check-latest: true - - id: go-cache-paths - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" - - name: Go Cache - uses: actions/cache@v2 - id: go-cache - if: ${{ runner.os != 'Windows' }} # Note [Windows Go Cache] in build.yml - with: - path: | - ${{ steps.go-cache-paths.outputs.go-build }} - ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-cache-${{ hashFiles('*/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - cache: pip - cache-dependency-path: sdk/python/requirements.txt - - name: Set up DotNet ${{ matrix.dotnet-version }} - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ matrix.dotnet-version }} - name: Set up Node ${{ matrix.node-version }} uses: actions/setup-node@v2 with: @@ -73,231 +27,28 @@ jobs: cache-dependency-path: sdk/nodejs/package.json registry-url: https://registry.npmjs.org always-auth: true - - name: Install Python deps - run: | - python -m pip install --upgrade pip requests wheel urllib3 chardet twine - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.7.1 with: repo: pulumi/pulumictl tag: v0.0.32 cache: enable + - name: Install pipenv + uses: dschep/install-pipenv-action@v1 - name: Fetch Tags - run: | - git fetch --quiet --prune --unshallow --tags + run: git fetch --quiet --prune --unshallow --tags - name: Update path - run: | - echo "${{ runner.temp }}/opt/pulumi/bin" >> $GITHUB_PATH - - name: Set Go Dep path - run: | - echo "PULUMI_GO_DEP_ROOT=$(dirname $(pwd))" >> $GITHUB_ENV + run: echo "${{ runner.temp }}/opt/pulumi/bin" >> $GITHUB_PATH - name: Ensure - run: | - make ensure + run: make ensure - run: git status + - name: Configure NPM authentication + run: | + yarn config set npmAlwaysAuth true + yarn config set npmAuthToken ${{ secrets.NPM_TOKEN }} - name: Publish Packages env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: | make -C sdk/${{ matrix.language}} publish - publish-binaries: - name: Publish Binaries - uses: ./.github/workflows/publish-binaries.yml - needs: [lint, language-sdk-lint, build, test-linux, test-windows, test-macos, versions] - with: - goreleaser-config: .goreleaser.prerelease.yml - goreleaser-flags: -p 3 --skip-validate - secrets: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_UPLOAD_ROLE_ARN: ${{ secrets.AWS_UPLOAD_ROLE_ARN }} - INPUT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} - - # examples_smoke_test: - # name: Trigger Examples Smoke Test - # runs-on: ubuntu-latest - # needs: publish-sdks - # steps: - # - name: Checkout Repo - # uses: actions/checkout@v2 - # - name: Install pulumictl - # uses: jaxxstorm/action-install-gh-release@v1.7.1 - # with: - # repo: pulumi/pulumictl - # tag: v0.0.32 - # cache: enable - # - name: Repository Dispatch - # run: | - # pulumictl dispatch -r pulumi/examples -c smoke-test-cli $(pulumictl get version --language generic -o) - # env: - # GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN}} - lint: - # See https://github.com/pulumi/pulumi/issues/9280 for why this is set to v1.44 - container: golangci/golangci-lint:v1.44 - name: Lint ${{ matrix.directory }} - strategy: - matrix: - directory: [sdk, pkg, tests] - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Lint ${{ matrix.directory }} - run: | - cd ${{ matrix.directory }} && golangci-lint run -c ../.golangci.yml - language-sdk-lint: - name: Lint Language SDKs - strategy: - matrix: - go-version: [1.17.x] - python-version: [3.9.x] - dotnet-version: [6.0.x] - node-version: [14.x] - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Set up Go ${{ matrix.go-version }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - check-latest: true - - id: go-cache-paths - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" - - name: Go Cache - uses: actions/cache@v2 - id: go-cache - if: ${{ runner.os != 'Windows' }} # Note [Windows Go Cache] in build.yml - with: - path: | - ${{ steps.go-cache-paths.outputs.go-build }} - ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-cache-${{ hashFiles('*/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - cache: pip - cache-dependency-path: sdk/python/requirements.txt - - name: Set up DotNet ${{ matrix.dotnet-version }} - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ matrix.dotnet-version }} - - run: mkdir -p ${{ runner.temp }}/opt/pulumi/nuget - - name: Add NuGet packages as a local NuGet source - run: | - echo $(which dotnet) - echo $(dotnet --version) - dotnet nuget add source ${{ runner.temp }}/opt/pulumi/nuget - - name: Set up Node ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - cache: yarn - cache-dependency-path: sdk/nodejs/package.json - - name: Install Python deps - run: | - python -m pip install --upgrade pip requests wheel urllib3 chardet - - name: Setup git - run: | - git config --global user.email "you@example.com" - git config --global user.name "Your Name" - - name: Update path - run: | - echo "${{ runner.temp }}/opt/pulumi/bin" >> $GITHUB_PATH - - name: Fetch Tags - run: | - git fetch --quiet --prune --unshallow --tags - - name: Set Go Dep path - run: | - echo "PULUMI_GO_DEP_ROOT=$(dirname $(pwd))" >> $GITHUB_ENV - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.7.1 - with: - repo: pulumi/pulumictl - tag: v0.0.32 - cache: enable - - name: Ensure - run: | - make ensure - - name: Lint Node - run: | - cd sdk/nodejs && make lint - - name: Lint Python - run: | - cd sdk/python && make lint - - name: Lint .NET - run: | - cd sdk/dotnet && make lint - versions: - name: Versions - uses: ./.github/workflows/versions.yml - build: - name: Build - uses: ./.github/workflows/build.yml - needs: versions - with: - enable-coverage: true - goreleaser-flags: -p 3 --skip-validate - test-linux: - name: Test Linux - needs: build - uses: ./.github/workflows/test.yml - with: - enable-coverage: true - platform: ubuntu-latest - secrets: - pulumi-access-token: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }} - test-macos: - name: Test MacOS - needs: build - uses: ./.github/workflows/test-fast.yml - with: - enable-coverage: true - platform: macos-latest - secrets: - pulumi-access-token: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }} - test-windows: - name: Test Windows - needs: build - uses: ./.github/workflows/test-fast.yml - with: - enable-coverage: true - platform: windows-latest - secrets: - pulumi-access-token: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }} - dispatch-docker-containers-ci-build: - name: Trigger Docker containers CI build - needs: [publish-binaries, publish-sdks, versions] - runs-on: ubuntu-latest - steps: - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.7.1 - with: - repo: pulumi/pulumictl - tag: v0.0.32 - cache: enable - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Fetch Tags - run: | - git fetch --quiet --prune --unshallow --tags - - name: Download versions.txt - uses: actions/download-artifact@v2 - with: - name: versions.txt - path: versions - - name: Setup versioning env vars - run: | - cat versions/versions.txt | tee $GITHUB_ENV - rm -rf versions - - name: Run Container Tests - run: pulumictl dispatch -r pulumi/pulumi-docker-containers -c ci-build $GENERIC_VERSION - env: - GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml deleted file mode 100644 index 88c5edce21b6..000000000000 --- a/.github/workflows/pr.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: New Pull Request -on: - pull_request_target: - -jobs: - comment-on-pr: - # We only care about commenting on a PR if the PR is from a fork - if: github.event.pull_request.head.repo.full_name != github.repository - runs-on: ubuntu-latest - steps: - - name: Comment PR - uses: thollander/actions-comment-pull-request@1.0.1 - with: - message: | - PR is now waiting for a maintainer to take action. - - **Note for the maintainer:** Commands available: - - * `/run-acceptance-tests` - used to test run the acceptance tests for the project - * `/run-integration-tests` - used to run the full integration tests for the project - * `/run-codegen` - used to test the Pull Request against downstream codegen - * `/run-docs-gen` - used to test the Pull Request against documentation generation - * `/run-containers` - used to test the Pull Request against the containers tests - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml deleted file mode 100644 index fa82fce9618d..000000000000 --- a/.github/workflows/prerelease.yml +++ /dev/null @@ -1,282 +0,0 @@ -on: - push: - tags: - - v*.*.*-** - paths-ignore: - - "CHANGELOG.md" - - "CHANGELOG_PENDING.md" - - "README.md" -env: - PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PULUMI_TEST_OWNER: "moolumi" - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} - PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - TRAVIS_PUBLISH_PACKAGES: true - IS_PRERELEASE: true - PYTHON: python - DOTNET_CLI_TELEMETRY_OPTOUT: "true" - DOTNET_ROLL_FORWARD: "Major" - -jobs: - publish-sdks: - name: Publish SDKs - runs-on: ubuntu-latest - needs: publish-binaries - strategy: - matrix: - go-version: [1.17.x] - python-version: [3.9.x] - dotnet-version: [6.0.x] - node-version: [14.x] - language: ["nodejs", "python", "dotnet"] - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Set up Go ${{ matrix.go-version }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - check-latest: true - - id: go-cache-paths - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" - - name: Go Cache - uses: actions/cache@v2 - id: go-cache - if: ${{ runner.os != 'Windows' }} # Note [Windows Go Cache] in build.yml - with: - path: | - ${{ steps.go-cache-paths.outputs.go-build }} - ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-cache-${{ hashFiles('*/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - cache: pip - cache-dependency-path: sdk/python/requirements.txt - - name: Set up DotNet ${{ matrix.dotnet-version }} - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ matrix.dotnet-version }} - - name: Set up Node ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - cache: yarn - cache-dependency-path: sdk/nodejs/package.json - registry-url: https://registry.npmjs.org - always-auth: true - - name: Install Python deps - run: | - python -m pip install --upgrade pip requests wheel urllib3 chardet twine - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.7.1 - with: - repo: pulumi/pulumictl - tag: v0.0.32 - cache: enable - - name: Fetch Tags - run: | - git fetch --quiet --prune --unshallow --tags - - name: Update path - run: | - echo "${{ runner.temp }}/opt/pulumi/bin" >> $GITHUB_PATH - - name: Set Go Dep path - run: | - echo "PULUMI_GO_DEP_ROOT=$(dirname $(pwd))" >> $GITHUB_ENV - - name: Ensure - run: | - make ensure - - name: Publish Packages - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - make -C sdk/${{ matrix.language}} publish - - publish-binaries: - name: Publish Binaries - needs: [lint, build, test-linux, test-macos, test-windows, versions] - uses: ./.github/workflows/publish-binaries.yml - with: - goreleaser-config: .goreleaser.prerelease.yml - goreleaser-flags: -p 3 - secrets: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_UPLOAD_ROLE_ARN: ${{ secrets.AWS_UPLOAD_ROLE_ARN }} - INPUT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} - - lint: - # See https://github.com/pulumi/pulumi/issues/9280 for why this is set to v1.44 - container: golangci/golangci-lint:v1.44 - name: Lint ${{ matrix.directory }} - strategy: - matrix: - directory: [sdk, pkg, tests] - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Lint ${{ matrix.directory }} - run: | - cd ${{ matrix.directory }} && golangci-lint run -c ../.golangci.yml - language-sdk-lint: - name: Lint Language SDKs - strategy: - matrix: - go-version: [1.17.x] - python-version: [3.9.x] - dotnet-version: [6.0.x] - node-version: [14.x] - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Set up Go ${{ matrix.go-version }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - check-latest: true - - id: go-cache-paths - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" - - name: Go Cache - uses: actions/cache@v2 - id: go-cache - if: ${{ runner.os != 'Windows' }} # Note [Windows Go Cache] in build.yml - with: - path: | - ${{ steps.go-cache-paths.outputs.go-build }} - ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-cache-${{ hashFiles('*/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - cache: pip - cache-dependency-path: sdk/python/requirements.txt - - name: Set up DotNet ${{ matrix.dotnet-version }} - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ matrix.dotnet-version }} - - run: mkdir -p ${{ runner.temp }}/opt/pulumi/nuget - - name: Add NuGet packages as a local NuGet source - run: | - echo $(which dotnet) - echo $(dotnet --version) - dotnet nuget add source ${{ runner.temp }}/opt/pulumi/nuget - - name: Set up Node ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - cache: yarn - cache-dependency-path: sdk/nodejs/package.json - - name: Install Python deps - run: | - python -m pip install --upgrade pip requests wheel urllib3 chardet - - name: Setup git - run: | - git config --global user.email "you@example.com" - git config --global user.name "Your Name" - - name: Update path - run: | - echo "${{ runner.temp }}/opt/pulumi/bin" >> $GITHUB_PATH - - name: Fetch Tags - run: | - git fetch --quiet --prune --unshallow --tags - - name: Set Go Dep path - run: | - echo "PULUMI_GO_DEP_ROOT=$(dirname $(pwd))" >> $GITHUB_ENV - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.7.1 - with: - repo: pulumi/pulumictl - tag: v0.0.32 - cache: enable - - name: Ensure - run: | - make ensure - - name: Lint Node - run: | - cd sdk/nodejs && make lint - - name: Lint Python - run: | - cd sdk/python && make lint - - name: Lint .NET - run: | - cd sdk/dotnet && make lint - versions: - name: Versions - uses: ./.github/workflows/versions.yml - build: - name: Build - needs: versions - uses: ./.github/workflows/build.yml - with: - enable-coverage: false - goreleaser-flags: -p 3 - test-linux: - name: Test Linux - needs: build - uses: pulumi/pulumi/.github/workflows/test-fast.yml@master - with: - enable-coverage: false - platform: ubuntu-latest - secrets: - pulumi-access-token: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }} - test-macos: - name: Test MacOS - needs: build - uses: pulumi/pulumi/.github/workflows/test-fast.yml@master - with: - enable-coverage: false - platform: macos-latest - secrets: - pulumi-access-token: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }} - test-windows: - name: Test Windows - needs: build - uses: pulumi/pulumi/.github/workflows/test-fast.yml@master - with: - enable-coverage: false - platform: windows-latest - secrets: - pulumi-access-token: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }} - dispatch-docker-containers-ci-build: - name: Dispatch Docker containers CI build - needs: [publish-binaries, publish-sdks, versions] - runs-on: ubuntu-latest - steps: - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.7.1 - with: - repo: pulumi/pulumictl - tag: v0.0.32 - cache: enable - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Fetch Tags - run: | - git fetch --quiet --prune --unshallow --tags - - name: Download versions.txt - uses: actions/download-artifact@v2 - with: - name: versions.txt - path: versions - - name: Setup versioning env vars - run: | - cat versions/versions.txt | tee $GITHUB_ENV - rm -rf versions - - name: Dispatch event - run: pulumictl dispatch -r pulumi/pulumi-docker-containers -c ci-build $GENERIC_VERSION diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 61fcf16e6152..000000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,461 +0,0 @@ -on: - push: - tags: - - v*.*.* - - '!v*.*.*-**' - paths-ignore: - - "CHANGELOG.md" - - "CHANGELOG_PENDING.md" - - "README.md" -env: - PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }} - GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} - PULUMI_TEST_OWNER: "moolumi" - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} - PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - TRAVIS_PUBLISH_PACKAGES: true - PYTHON: python - DOTNET_CLI_TELEMETRY_OPTOUT: "true" - DOTNET_ROLL_FORWARD: "Major" - -jobs: - templates_smoke_test: - name: Trigger Templates Smoke Test - runs-on: ubuntu-latest - needs: [publish-sdks, versions] - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.7.1 - with: - repo: pulumi/pulumictl - tag: v0.0.32 - cache: enable - - name: Download versions.txt - uses: actions/download-artifact@v2 - with: - name: versions.txt - path: versions - - name: Setup versioning env vars - run: | - cat versions/versions.txt | tee $GITHUB_ENV - rm -rf versions - - name: Repository Dispatch - run: | - pulumictl dispatch -r pulumi/templates -c trigger-cron $GENERIC_VERSION - env: - GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN}} - update-templates-version: - name: Trigger Updating Templates Version - runs-on: ubuntu-latest - needs: [templates_smoke_test, versions] - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Install Pulumictl - uses: jaxxstorm/action-install-gh-release@v1.7.1 - with: - repo: pulumi/pulumictl - tag: v0.0.32 - cache: enable - - name: Download versions.txt - uses: actions/download-artifact@v2 - with: - name: versions.txt - path: versions - - name: Setup versioning env vars - run: | - cat versions/versions.txt | tee $GITHUB_ENV - rm -rf versions - - name: Repository Dispatch - run: pulumictl dispatch -r pulumi/templates -c update-templates $GENERIC_VERSION - examples_smoke_test: - name: Trigger Examples Smoke Test - runs-on: ubuntu-latest - needs: [publish-sdks, versions] - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.7.1 - with: - repo: pulumi/pulumictl - tag: v0.0.32 - cache: enable - - name: Download versions.txt - uses: actions/download-artifact@v2 - with: - name: versions.txt - path: versions - - name: Setup versioning env vars - run: | - cat versions/versions.txt | tee $GITHUB_ENV - rm -rf versions - - name: Repository Dispatch - run: | - pulumictl dispatch -r pulumi/examples -c smoke-test-cli $GENERIC_VERSION - env: - GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN}} - chocolatey: - name: Chocolatey update - runs-on: ubuntu-latest - needs: publish-sdks - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.7.1 - with: - repo: pulumi/pulumictl - tag: v0.0.32 - cache: enable - - name: Download versions.txt - uses: actions/download-artifact@v2 - with: - name: versions.txt - path: versions - - name: Setup versioning env vars - run: | - cat versions/versions.txt | tee $GITHUB_ENV - rm -rf versions - - name: Repository Dispatch - run: | - pulumictl create choco-deploy $GENERIC_VERSION - env: - GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN}} - winget: - name: Winget Update - runs-on: ubuntu-latest - needs: publish-sdks - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.7.1 - with: - repo: pulumi/pulumictl - tag: v0.0.32 - cache: enable - - name: Repository Dispatch - run: | - pulumictl winget-deploy - env: - GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} - docs: - name: Build Package Docs - runs-on: ubuntu-latest - needs: [publish-sdks, versions] - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.7.1 - with: - repo: pulumi/pulumictl - tag: v0.0.32 - cache: enable - - name: Download versions.txt - uses: actions/download-artifact@v2 - with: - name: versions.txt - path: versions - - name: Setup versioning env vars - run: | - cat versions/versions.txt | tee $GITHUB_ENV - rm -rf versions - - name: Repository Dispatch - run: | - pulumictl create cli-docs-build $GENERIC_VERSION - env: - GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN}} - homebrew: - name: Update Homebrew - runs-on: macos-latest - needs: [publish-sdks, versions] - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.7.1 - with: - repo: pulumi/pulumictl - tag: v0.0.32 - cache: enable - - name: Download versions.txt - uses: actions/download-artifact@v2 - with: - name: versions.txt - path: versions - - name: Setup versioning env vars - run: | - cat versions/versions.txt | tee $GITHUB_ENV - rm -rf versions - - name: Repository Dispatch - run: | - pulumictl create homebrew-bump $GENERIC_VERSION ${{ github.sha }} - env: - GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN}} - publish-sdks: - name: Publish SDKs - runs-on: ubuntu-latest - needs: publish-binaries - strategy: - matrix: - go-version: [1.17.x] - python-version: [3.9.x] - dotnet-version: [6.0.x] - node-version: [14.x] - language: ["nodejs", "python", "dotnet"] - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Set up Go ${{ matrix.go-version }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - check-latest: true - - id: go-cache-paths - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" - - name: Go Cache - uses: actions/cache@v2 - id: go-cache - if: ${{ runner.os != 'Windows' }} # Note [Windows Go Cache] in build.yml - with: - path: | - ${{ steps.go-cache-paths.outputs.go-build }} - ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-cache-${{ hashFiles('*/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - cache: pip - cache-dependency-path: sdk/python/requirements.txt - - name: Set up DotNet ${{ matrix.dotnet-version }} - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ matrix.dotnet-version }} - - name: Set up Node ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - cache: yarn - cache-dependency-path: sdk/nodejs/package.json - registry-url: https://registry.npmjs.org - always-auth: true - - name: Install Python deps - run: | - python -m pip install --upgrade pip requests wheel urllib3 chardet twine - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.7.1 - with: - repo: pulumi/pulumictl - tag: v0.0.32 - cache: enable - - name: Fetch Tags - run: | - git fetch --quiet --prune --unshallow --tags - - name: Update path - run: | - echo "${{ runner.temp }}/opt/pulumi/bin" >> $GITHUB_PATH - - name: Set Go Dep path - run: | - echo "PULUMI_GO_DEP_ROOT=$(dirname $(pwd))" >> $GITHUB_ENV - - name: Ensure - run: | - make ensure - - name: Publish Packages - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - make -C sdk/${{ matrix.language}} publish - - publish-binaries: - name: Publish Binaries - needs: [lint, build, test-linux, test-macos, test-windows, versions] - uses: ./.github/workflows/publish-binaries.yml - with: - goreleaser-config: .goreleaser.yml - goreleaser-flags: -p 3 --release-notes=CHANGELOG_PENDING.md - secrets: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_UPLOAD_ROLE_ARN: ${{ secrets.AWS_UPLOAD_ROLE_ARN }} - INPUT_GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} - GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} - - lint: - # See https://github.com/pulumi/pulumi/issues/9280 for why this is set to v1.44 - container: golangci/golangci-lint:v1.44 - name: Lint ${{ matrix.directory }} - strategy: - matrix: - directory: [sdk, pkg, tests] - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Lint ${{ matrix.directory }} - run: | - cd ${{ matrix.directory }} && golangci-lint run -c ../.golangci.yml - language-sdk-lint: - name: Lint Language SDKs - strategy: - matrix: - go-version: [1.17.x] - python-version: [3.9.x] - dotnet-version: [6.0.x] - node-version: [14.x] - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Set up Go ${{ matrix.go-version }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - check-latest: true - - id: go-cache-paths - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" - - name: Go Cache - uses: actions/cache@v2 - id: go-cache - if: ${{ runner.os != 'Windows' }} # Note [Windows Go Cache] in build.yml - with: - path: | - ${{ steps.go-cache-paths.outputs.go-build }} - ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-cache-${{ hashFiles('*/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - cache: pip - cache-dependency-path: sdk/python/requirements.txt - - name: Set up DotNet ${{ matrix.dotnet-version }} - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ matrix.dotnet-version }} - - run: mkdir -p ${{ runner.temp }}/opt/pulumi/nuget - - name: Add NuGet packages as a local NuGet source - run: | - echo $(which dotnet) - echo $(dotnet --version) - dotnet nuget add source ${{ runner.temp }}/opt/pulumi/nuget - - name: Set up Node ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - cache: yarn - cache-dependency-path: sdk/nodejs/package.json - - name: Install Python deps - run: | - python -m pip install --upgrade pip requests wheel urllib3 chardet - - name: Setup git - run: | - git config --global user.email "you@example.com" - git config --global user.name "Your Name" - - name: Update path - run: | - echo "${{ runner.temp }}/opt/pulumi/bin" >> $GITHUB_PATH - - name: Fetch Tags - run: | - git fetch --quiet --prune --unshallow --tags - - name: Set Go Dep path - run: | - echo "PULUMI_GO_DEP_ROOT=$(dirname $(pwd))" >> $GITHUB_ENV - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.7.1 - with: - repo: pulumi/pulumictl - tag: v0.0.32 - cache: enable - - name: Ensure - run: | - make ensure - - name: Lint Node - run: | - cd sdk/nodejs && make lint - - name: Lint Python - run: | - cd sdk/python && make lint - - name: Lint .NET - run: | - cd sdk/dotnet && make lint - versions: - name: Versions - uses: ./.github/workflows/versions.yml - build: - name: Build - needs: versions - uses: ./.github/workflows/build.yml - with: - enable-coverage: false - goreleaser-flags: -p 3 - test-linux: - name: Test Linux - needs: build - uses: pulumi/pulumi/.github/workflows/test-fast.yml@master - with: - enable-coverage: false - platform: ubuntu-latest - secrets: - pulumi-access-token: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }} - test-macos: - name: Test MacOS - needs: build - uses: pulumi/pulumi/.github/workflows/test-fast.yml@master - with: - enable-coverage: false - platform: macos-latest - secrets: - pulumi-access-token: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }} - test-windows: - name: Test Windows - needs: build - uses: pulumi/pulumi/.github/workflows/test-fast.yml@master - with: - enable-coverage: false - platform: windows-latest - secrets: - pulumi-access-token: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }} - dispatch-docker-containers-release-build: - name: Dispatch Docker containers release build - needs: [publish-binaries, publish-sdks] - runs-on: ubuntu-latest - steps: - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.7.1 - with: - repo: pulumi/pulumictl - tag: v0.0.32 - cache: enable - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Fetch Tags - run: | - git fetch --quiet --prune --unshallow --tags - - name: Download versions.txt - uses: actions/download-artifact@v2 - with: - name: versions.txt - path: versions - - name: Setup versioning env vars - run: | - cat versions/versions.txt | tee $GITHUB_ENV - rm -rf versions - - name: Dispatch event - run: pulumictl dispatch -r pulumi/pulumi-docker-containers -c release-build $GENERIC_VERSION - env: - GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} diff --git a/.github/workflows/run-build-and-acceptance-tests.yml b/.github/workflows/run-build-and-acceptance-tests.yml deleted file mode 100644 index 79813cb251cb..000000000000 --- a/.github/workflows/run-build-and-acceptance-tests.yml +++ /dev/null @@ -1,226 +0,0 @@ -on: - repository_dispatch: - types: [ run-acceptance-tests-command ] - pull_request: - paths-ignore: - - 'CHANGELOG.md' - - 'CHANGELOG_PENDING.md' - -defaults: - run: - shell: bash - -env: - PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PULUMI_TEST_OWNER: "moolumi" - PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} - PYTHON: python - DOTNET_CLI_TELEMETRY_OPTOUT: "true" - DOTNET_ROLL_FORWARD: "Major" - -# Cancel checks on prior commits when new commits are added to a PR. -# This is motivated by temporary throughput issues on our GitHub -# Actions workers availability. -# -# Note from GitHub docs: Concurrency is currently in beta and subject -# to change. -# -# See also: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency -# -# Note on the the `group` computed expression: it is compiling -# `github.head_ref == '' ? github.run_id : github.head_ref` expression -# to the primitives available in GitHub Actions. The idea to use -# `head_ref` on `pull_request` triggers, but use unique -# `github.run_id` on `run-acceptance-tests-command` triggers. This -# effectively disables `concurrency` checks for -# `run-acceptance-tests-command` triggers. -concurrency: - group: run-build-acceptance-tests-${{(fromJSON(format('[{0},{1}]',toJSON(github.head_ref),toJSON(github.run_id))))[github.head_ref=='']}} - cancel-in-progress: true - -jobs: - - comment-notification: - # We only care about adding the result to the PR if it's a repository_dispatch event - if: github.event_name == 'repository_dispatch' - runs-on: ubuntu-latest - steps: - - name: Create URL to the run output - id: vars - run: echo ::set-output name=run-url::https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID - - name: Update with Result - uses: peter-evans/create-or-update-comment@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - repository: ${{ github.event.client_payload.github.payload.repository.full_name }} - issue-number: ${{ github.event.client_payload.github.payload.issue.number }} - body: | - Please view the results of the PR Build + Acceptance Tests Run [Here][1] - - [1]: ${{ steps.vars.outputs.run-url }} - - go-lint: - # See https://github.com/pulumi/pulumi/issues/9280 for why this is set to v1.44 - container: golangci/golangci-lint:v1.44 - name: Lint ${{ matrix.directory }} - strategy: - matrix: - directory: [ sdk, pkg, tests ] - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - with: - ref: ${{ env.PR_COMMIT_SHA }} - - name: Lint ${{ matrix.directory }} - run: | - cd ${{ matrix.directory }} && golangci-lint run -c ../.golangci.yml - - protobuf-lint: - name: Check Protobufs - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - with: - ref: ${{ env.PR_COMMIT_SHA }} - # This till display missing pulumictl errors, but it won't prevent the lint from working. - - name: Check Protobufs - run: | - make check-proto - - sdk-lint: - name: Lint SDKs - runs-on: ubuntu-latest - strategy: - matrix: - go-version: [1.17.x] - python-version: [3.9.x] - dotnet-version: [6.0.x] - node-version: [14.x] - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - with: - ref: ${{ env.PR_COMMIT_SHA }} - - name: Set up Go ${{ matrix.go-version }} - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - check-latest: true - - id: go-cache-paths - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" - - name: Go Cache - uses: actions/cache@v2 - id: go-cache - if: ${{ runner.os != 'Windows' }} # Note [Windows Go Cache] in build.yml - with: - path: | - ${{ steps.go-cache-paths.outputs.go-build }} - ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-cache-${{ hashFiles('*/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - cache: pip - cache-dependency-path: sdk/python/requirements.txt - - name: Set up DotNet ${{ matrix.dotnet-version }} - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ matrix.dotnet-version }} - - run: mkdir -p ${{ runner.temp }}/opt/pulumi/nuget - - name: Add NuGet packages as a local NuGet source - run: | - echo $(which dotnet) - echo $(dotnet --version) - dotnet nuget add source ${{ runner.temp }}/opt/pulumi/nuget - - name: Set up Node ${{ inputs.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ inputs.node-version }} - cache: yarn - cache-dependency-path: sdk/nodejs/package.json - - name: Install Python deps - run: | - python -m pip install --upgrade pip requests wheel urllib3 chardet - - name: Setup git - run: | - git config --global user.email "you@example.com" - git config --global user.name "Your Name" - - name: Update path - run: | - echo "${{ runner.temp }}/opt/pulumi/bin" >> $GITHUB_PATH - - name: Fetch Tags - run: | - git fetch --quiet --prune --unshallow --tags - - name: Set Go Dep path - run: | - echo "PULUMI_GO_DEP_ROOT=$(dirname $(pwd))" >> $GITHUB_ENV - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.7.1 - with: - repo: pulumi/pulumictl - tag: v0.0.32 - cache: enable - - name: Ensure - run: | - make ensure - - name: Lint Node - run: | - cd sdk/nodejs && make lint - - name: Lint Python - run: | - cd sdk/python && make lint - - name: Lint .NET - run: | - cd sdk/dotnet && make lint - - versions: - name: Versions - uses: ./.github/workflows/versions.yml - - build: - name: Build - uses: ./.github/workflows/build.yml - needs: versions - with: - enable-coverage: true - goreleaser-flags: -p 3 --skip-validate - macos-build-platform: ubuntu-latest - - test-linux: - name: Test Linux - needs: build - uses: ./.github/workflows/test-fast.yml - if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name == github.repository - with: - enable-coverage: true - platform: ubuntu-latest - secrets: - pulumi-access-token: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }} - test-macos: - name: Test MacOS - needs: build - uses: ./.github/workflows/test-minimal.yml - if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name == github.repository - with: - enable-coverage: true - platform: macos-latest - secrets: - pulumi-access-token: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }} - test-windows: - name: Test Windows - needs: build - uses: ./.github/workflows/test-minimal.yml - if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name == github.repository - with: - enable-coverage: true - platform: windows-latest - secrets: - pulumi-access-token: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }} diff --git a/.github/workflows/run-codegen-test.yml b/.github/workflows/run-codegen-test.yml deleted file mode 100644 index d8c6e6bba069..000000000000 --- a/.github/workflows/run-codegen-test.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: Downstream Codegen Tests -on: - repository_dispatch: - types: [ run-codegen-command ] - pull_request: - paths: - - 'pkg/codegen/**' - - '!pkg/codegen/docs/**' - - '.github/workflows/run-codegen-test.yml' - -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} - DOTNET_ROLL_FORWARD: "Major" - -jobs: - comment-notification: - runs-on: ubuntu-latest - if: github.event_name == 'repository_dispatch' - steps: - - name: Create URL to the run output - id: vars - run: echo ::set-output name=run-url::$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID - - name: Update with Result - uses: peter-evans/create-or-update-comment@v2 - with: - token: ${{ secrets.PULUMI_BOT_TOKEN }} - repository: ${{ github.event.client_payload.github.payload.repository.full_name }} - comment-id: ${{ github.event.client_payload.github.payload.comment.id }} - issue-number: ${{ github.event.client_payload.github.payload.issue.number }} - body: | - Please view the results of the Downstream Codegen Tests [Here][1] - - [1]: ${{ steps.vars.outputs.run-url }} - comment-notification-pr: - runs-on: ubuntu-latest - if: github.event_name == 'pull_request' - steps: - - name: Create URL to the run output - id: vars - run: echo ::set-output name=run-url::$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID - - name: Update with Result - uses: peter-evans/create-or-update-comment@v2 - with: - token: ${{ secrets.PULUMI_BOT_TOKEN }} - issue-number: ${{ github.event.pull_request.number }} - body: | - Please view the results of the Downstream Codegen Tests [Here][1] - - [1]: ${{ steps.vars.outputs.run-url }} - downstream-test: - name: Test ${{ matrix.provider }} Downstream - if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name == github.repository - runs-on: ubuntu-latest - strategy: - matrix: - provider: ["aws", "gcp", "azure", "azuread", "random", "kubernetes"] - fail-fast: false - steps: - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: 1.18.x - check-latest: true - - name: Install Node.js - uses: actions/setup-node@v1 - with: - node-version: '14.x' - - name: Install Python - uses: actions/setup-python@v3 - with: - python-version: 3.9.x - - name: Install Pulumi CLI - uses: pulumi/action-install-pulumi-cli@v1.0.1 - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.7.1 - with: - repo: pulumi/pulumictl - tag: v0.0.32 - cache: enable - - name: Check out source code - uses: actions/checkout@v2 - with: - ref: ${{ env.PR_COMMIT_SHA }} - - name: Test Downstream - uses: pulumi/action-test-provider-downstream@v1.0.0 - env: - GOPROXY: "https://proxy.golang.org" - with: - GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} - replacements: github.com/pulumi/pulumi/pkg/v3=pulumi/pkg,github.com/pulumi/pulumi/sdk/v3=pulumi/sdk - downstream-name: pulumi-${{ matrix.provider }} - downstream-url: https://github.com/pulumi/pulumi-${{ matrix.provider }} - use-provider-dir: true - issue-number: ${{ github.event.client_payload.github.payload.issue.number }} diff --git a/.github/workflows/run-docs-generation.yml b/.github/workflows/run-docs-generation.yml deleted file mode 100644 index 48d36b1f2a0c..000000000000 --- a/.github/workflows/run-docs-generation.yml +++ /dev/null @@ -1,141 +0,0 @@ -name: Downstream Resource Docs Test -on: - repository_dispatch: - types: [ run-docs-gen-command ] - pull_request: - paths: - - 'pkg/codegen/docs/**' - - 'pkg/codegen/docs/docs.go' - - 'pkg/codegen/docs/docs_test.go' - - '.github/workflows/run-docs-generation.yml' - -env: - GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} - PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} - DOTNET_ROLL_FORWARD: "Major" - -jobs: - comment-notification: - if: github.event_name == 'repository_dispatch' - runs-on: ubuntu-latest - steps: - - name: Create URL to the run output - id: vars - run: echo ::set-output name=run-url::https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID - - name: Update with Result - uses: peter-evans/create-or-update-comment@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - repository: ${{ github.event.client_payload.github.payload.repository.full_name }} - issue-number: ${{ github.event.client_payload.github.payload.issue.number }} - body: | - Please view the results of the Docs Generation Tests [Here][1] - - [1]: ${{ steps.vars.outputs.run-url }} - aws: - name: Resource Docs - # Verify that the event is not triggered by a fork since forks cannot - # access secrets other than the default GITHUB_TOKEN. Specifically, - # this workflow relies on the secret PULUMI_BOT_GH_PAT_DOCS to create a - # draft PR in the docs repo. - if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name == github.repository - env: - GOPATH: ${{ github.workspace }} - runs-on: ubuntu-latest - strategy: - matrix: - go-version: [ 1.17.x ] - node-version: [ 14.x ] - steps: - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - check-latest: true - - name: Install Node.js - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: Install Pulumi CLI - uses: pulumi/action-install-pulumi-cli@v1.0.1 - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.7.1 - with: - repo: pulumi/pulumictl - tag: v0.0.32 - cache: enable - - name: Check out source code - uses: actions/checkout@v2 - with: - path: pulumi - ref: ${{ env.PR_COMMIT_SHA }} - - name: Check out pulumi-aws - uses: actions/checkout@v2 - with: - repository: pulumi/pulumi-aws - path: pulumi-aws - - name: Check out pulumi-kubernetes - uses: actions/checkout@v2 - with: - repository: pulumi/pulumi-kubernetes - path: pulumi-kubernetes - - name: Check out docs - uses: actions/checkout@v2 - with: - # Use the PAT and not the default GITHUB_TOKEN since we want to create a branch - # in this workflow and push it to a remote that is NOT the current repo, i.e. pulumi/pulumi. - token: ${{ secrets.PULUMI_BOT_GH_PAT_DOCS }} - repository: pulumi/docs - path: docs - - - name: Regenerate resource docs - id: regenerate-resource-docs - run: | - PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") - BRANCH_NAME="${GITHUB_ACTOR}/${PR_NUMBER}-test-generator-changes" - - # If generating docs for more providers here, be sure to update - # the description of the draft PR that is opened in the next step. - pushd docs - - pushd tools/resourcedocsgen - go mod edit -replace github.com/pulumi/pulumi/pkg/v3=../../../pulumi/pkg - go mod edit -replace github.com/pulumi/pulumi/sdk/v3=../../../pulumi/sdk - popd - - ./scripts/gen_resource_docs.sh aws true - ./scripts/gen_resource_docs.sh kubernetes true - - # Undo the changes to the go.mod and go.sum files since we don't want the PR - # to contain local overrides or the PR build in docs repo would fail. - pushd tools/resourcedocsgen - git checkout . - popd - - popd - - echo "::set-output name=branchName::${BRANCH_NAME}" - echo "::set-output name=prNumber::${PR_NUMBER}" - - - name: Create draft docs PR - uses: peter-evans/create-pull-request@v3 - with: - draft: true - # We use a repo:public scoped PAT instead of the implicitly provided GITHUB_TOKEN secret here - # because we want the creation of the docs PR to trigger the `on: pull_request` workflow in the - # docs repo. Using a fork repo to raise the PR would also cause the `on: pull_request` workflow - # to trigger, but currently Pulumify in the docs repo does not run for forks, but we want it to - # generate the preview link. - token: ${{ secrets.PULUMI_BOT_GH_PAT_DOCS }} - path: docs - committer: Pulumi Bot - author: Pulumi Bot - commit-message: Regenerate resource docs - title: Preview resource docs changes for pulumi/pulumi#${{ steps.regenerate-resource-docs.outputs.prNumber }} - body: | - This PR was auto-generated from pulumi/pulumi#${{ steps.regenerate-resource-docs.outputs.prNumber }}. - By default, this PR contains regenerated docs for AWS and Kubernetes only. - After review, this PR should be manually closed. - # Assign the draft PR to the author of the current PR. - assignees: ${{ github.event.pull_request.user.login }} - branch: ${{ steps.regenerate-resource-docs.outputs.branchName }} diff --git a/.github/workflows/trigger-homebrew-event.yml b/.github/workflows/trigger-homebrew-event.yml deleted file mode 100644 index 43277e0271bb..000000000000 --- a/.github/workflows/trigger-homebrew-event.yml +++ /dev/null @@ -1,21 +0,0 @@ -env: - GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} - VERSION: ${{ github.event.client_payload.ref }} - COMMIT_SHA: ${{ github.event.client_payload.commitSha }} - -on: - repository_dispatch: - types: - - homebrew-bump - -jobs: - homebrew: - name: Bump Homebrew formula - runs-on: ubuntu-latest - steps: - - uses: dawidd6/action-homebrew-bump-formula@v3 - with: - token: ${{secrets.PULUMI_BOT_TOKEN}} - formula: pulumi - tag: v${{env.VERSION}} - revision: ${{env.COMMIT_SHA}} diff --git a/.github/workflows/trigger-release-docs-event.yml b/.github/workflows/trigger-release-docs-event.yml deleted file mode 100644 index 6bed1fb4e2a1..000000000000 --- a/.github/workflows/trigger-release-docs-event.yml +++ /dev/null @@ -1,29 +0,0 @@ -env: - GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} - VERSION: ${{ github.event.client_payload.ref }} - COMMIT_SHA: ${{ github.event.client_payload.commitSha }} - -on: - repository_dispatch: - types: - - docs - -jobs: - docs: - name: Build Package Docs - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Checkout Scripts Repo - uses: actions/checkout@v2 - with: - path: ci-scripts - repository: pulumi/scripts - - name: Trigger Docs Build - run: | - ./ci-scripts/ci/build-package-docs.sh "pulumi" - env: - TRAVIS: true - PULUMI_BOT_GITHUB_API_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} - TRAVIS_TAG: ${{ env.VERSION }} diff --git a/scripts/publish_npm.sh b/scripts/publish_npm.sh index 6c9f87745782..7fd460a2e4bf 100755 --- a/scripts/publish_npm.sh +++ b/scripts/publish_npm.sh @@ -5,63 +5,22 @@ set -o errexit set -o pipefail readonly ROOT=$(dirname "${0}")/.. -if [[ "${TRAVIS_PUBLISH_PACKAGES:-}" == "true" ]]; then - echo "Publishing NPM package to NPMjs.com:" - NPM_TAG="dev" - - ## We need split the GITHUB_REF into the correct parts - ## so that we can test for NPM Tags - IFS='/' read -ra my_array <<< "${GITHUB_REF:-}" - BRANCH_NAME="${my_array[2]}" - - echo $BRANCH_NAME - if [[ "${BRANCH_NAME}" == features/* ]]; then - NPM_TAG=$(echo "${BRANCH_NAME}" | sed -e 's|^features/|feature-|g') - fi - - if [[ "${BRANCH_NAME}" == feature-* ]]; then - NPM_TAG=$(echo "${BRANCH_NAME}") - fi - - PKG_NAME=$(jq -r .name < "${ROOT}/sdk/nodejs/bin/package.json") - PKG_VERSION=$(jq -r .version < "${ROOT}/sdk/nodejs/bin/package.json") - - # If the package doesn't have an alpha tag, use the tag of latest instead of - # dev. NPM uses this tag as the default version to add, so we want it to mean - # the newest released version. - if [[ "${PKG_VERSION}" != *-alpha* ]]; then - NPM_TAG="latest" - fi - - # we need to set explicit beta and rc tags to ensure that we don't mutate to use the latest tag - if [[ "${PKG_VERSION}" == *-beta* ]]; then - NPM_TAG="beta" - fi - - if [[ "${PKG_VERSION}" == *-rc* ]]; then - NPM_TAG="rc" - fi - - # Now, perform the publish. The logic here is a little goofy because npm provides - # no way to say "if the package already exists, don't fail" but we want these - # semantics (so, for example, we can restart builds which may have failed after - # publishing, or so two builds can run concurrently, which is the case for when we - # tag master right after pushing a new commit and the push and tag travis jobs both - # get the same version. - # - # We exploit the fact that `npm info @` has no output - # when the package does not exist. - pushd "${ROOT}/sdk/nodejs/bin" - if [ "$(npm info ${PKG_NAME}@${PKG_VERSION})" == "" ]; then - if ! npm publish -tag "${NPM_TAG}"; then - # if we get here, we have a TOCTOU issue, so check again - # to see if it published. If it didn't bail out. - if [ "$(npm info ${PKG_NAME}@${PKG_VERSION})" == "" ]; then - echo "NPM publishing failed, aborting" - exit 1 - fi - fi - fi - npm info 2>/dev/null - popd -fi +echo "Publishing NPM package to NPMjs.com:" +NPM_TAG="latest" + +PKG_NAME="@transcend-io/pulumi" +PKG_VERSION="1.0.23" + +# Now, perform the publish. The logic here is a little goofy because npm provides +# no way to say "if the package already exists, don't fail" but we want these +# semantics (so, for example, we can restart builds which may have failed after +# publishing, or so two builds can run concurrently, which is the case for when we +# tag master right after pushing a new commit and the push and tag travis jobs both +# get the same version. +# +# We exploit the fact that `npm info @` has no output +# when the package does not exist. +pushd "${ROOT}/sdk/nodejs/bin" +npm publish -tag "${NPM_TAG}" --access=public +npm info 2>/dev/null +popd diff --git a/sdk/nodejs/cmd/run/run.ts b/sdk/nodejs/cmd/run/run.ts index e05da12cfce2..598292b2dee3 100644 --- a/sdk/nodejs/cmd/run/run.ts +++ b/sdk/nodejs/cmd/run/run.ts @@ -13,6 +13,7 @@ // limitations under the License. import * as fs from "fs"; +import * as typescript from "typescript"; import * as url from "url"; import * as minimist from "minimist"; import * as path from "path"; @@ -183,28 +184,32 @@ export function run( // find a tsconfig.json. For us, it's reasonable to say that the "root" of the project is the cwd, // if there's a tsconfig.json file here. Otherwise, just tell ts-node to not load project options at all. // This helps with cases like pulumi/pulumi#1772. - const defaultTsConfigPath = "tsconfig.json"; - const tsConfigPath: string = process.env["PULUMI_NODEJS_TSCONFIG_PATH"] ?? defaultTsConfigPath; - const skipProject = !fs.existsSync(tsConfigPath); + const skipProject = false; + const tsConfigPath = "tsconfig.json"; + + let compilerOptions = { + target: "es6", + module: "commonjs", + moduleResolution: "node", + sourceMap: "true", + // esModuleInterop: true, + } + try { + const tsConfigString = fs.readFileSync(tsConfigPath).toString(); + const ts: typeof typescript = require("typescript"); + const tsConfig = ts.parseConfigFileTextToJson(tsConfigPath, tsConfigString).config; + if (tsConfig["compilerOptions"]) { + compilerOptions = tsConfig["compilerOptions"]; + } + } catch (e) {} if (typeScript) { - const transpileOnly = (process.env["PULUMI_NODEJS_TRANSPILE_ONLY"] ?? "false") === "true"; - const compilerOptions = tsutils.loadTypeScriptCompilerOptions(tsConfigPath); - const tsn: typeof tsnode = require("ts-node"); - tsn.register({ - transpileOnly, - // PULUMI_NODEJS_TSCONFIG_PATH might be set to a config file such as "tsconfig.pulumi.yaml" which - // would not get picked up by tsnode by default, so we explicitly tell tsnode which config file to - // use (Which might just be ./tsconfig.yaml) - project: tsConfigPath, - skipProject: skipProject, - compilerOptions: { - target: "es6", - module: "commonjs", - moduleResolution: "node", - sourceMap: "true", - ...compilerOptions, - }, + tsnode.register({ + typeCheck: false, + transpileOnly: true, + files: true, + skipProject, + compilerOptions, }); } @@ -278,7 +283,7 @@ ${defaultMessage}`); programStarted(); // This needs to occur after `programStarted` to ensure execution of the parent process stops. - if (skipProject && tsConfigPath !== defaultTsConfigPath) { + if (skipProject) { return new Promise(() => { const e = new Error(`tsconfig path was set to ${tsConfigPath} but the file was not found`); e.stack = undefined; diff --git a/sdk/nodejs/package.json b/sdk/nodejs/package.json index 47777b4573a3..0ed404a66fb5 100644 --- a/sdk/nodejs/package.json +++ b/sdk/nodejs/package.json @@ -1,11 +1,11 @@ { - "name": "@pulumi/pulumi", - "version": "${VERSION}", - "description": "Pulumi's Node.js SDK", + "name": "@transcend-io/pulumi", + "version": "1.0.24", + "description": "Pulumi's Node.js SDK, forked by transcend-io", "license": "Apache-2.0", "repository": { "type": "git", - "url": "https://github.com/pulumi/pulumi.git", + "url": "https://github.com/transcend-io/pulumi.git", "directory": "sdk/nodejs" }, "dependencies": { @@ -41,10 +41,17 @@ "eslint": "^7.32.0", "eslint-plugin-header": "^3.1.1", "eslint-plugin-import": "^2.23.4", + "istanbul": "^0.4.5", "mocha": "^9.0.0", + "ts-node": ">7.0.1", + "typescript": ">3.7.3", "mockpackage": "file:tests/mockpackage", "nyc": "^15.1.0" }, + "peerDependencies": { + "ts-node": ">7.0.1", + "typescript": ">3.7.3" + }, "pulumi": { "comment": "Do not remove. Marks this as as a deployment-time-only package" },