jaxxstorm/build fixes (#5483)
* fix pulumi bot token and env var * use commit hash non-marketplace actions * fix goreleaser binaries foo * fix goreleaser archive format * update workflows to use repo-dispatch * fixing tag naming * add support for beta tags * add prerelease workflow * remove windows builds * only use travis for tags * remove prerelease steps * fix container build indentation * check the policy tempdir exists
This commit is contained in:
parent
42f301ac0f
commit
7093565e2c
37
.github/workflows/codegen-test.yml
vendored
37
.github/workflows/codegen-test.yml
vendored
|
@ -4,6 +4,7 @@ on:
|
|||
paths:
|
||||
- 'pkg/codegen/**'
|
||||
- '.github/workflows/codegen-test.yml'
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
@ -25,16 +26,16 @@ jobs:
|
|||
with:
|
||||
python-version: 3.6.x
|
||||
- name: Install Pulumi CLI
|
||||
uses: pulumi/action-install-pulumi-cli@releases/v1
|
||||
uses: pulumi/action-install-pulumi-cli@b811287a6e06bb7e5d8b91132b839c67e3f9c6ed
|
||||
- name: Install pulumictl
|
||||
uses: jaxxstorm/action-install-gh-release@release/v1-alpha
|
||||
uses: jaxxstorm/action-install-gh-release@6277ebec57d2f9283d245d365f0b05bcc23d85e0
|
||||
with:
|
||||
repo: pulumi/pulumictl
|
||||
|
||||
- name: Check out source code
|
||||
uses: actions/checkout@master
|
||||
- name: Test Downstream
|
||||
uses: pulumi/action-test-provider-downstream@releases/v4
|
||||
uses: pulumi/action-test-provider-downstream@093f43c86c9b4820e1e3c80df8feab04868890f7
|
||||
env:
|
||||
GOPROXY: "https://proxy.golang.org"
|
||||
with:
|
||||
|
@ -62,16 +63,16 @@ jobs:
|
|||
with:
|
||||
python-version: 3.6.x
|
||||
- name: Install Pulumi CLI
|
||||
uses: pulumi/action-install-pulumi-cli@releases/v1
|
||||
uses: pulumi/action-install-pulumi-cli@b811287a6e06bb7e5d8b91132b839c67e3f9c6ed
|
||||
- name: Install pulumictl
|
||||
uses: jaxxstorm/action-install-gh-release@release/v1-alpha
|
||||
uses: jaxxstorm/action-install-gh-release@6277ebec57d2f9283d245d365f0b05bcc23d85e0
|
||||
with:
|
||||
repo: pulumi/pulumictl
|
||||
|
||||
- name: Check out source code
|
||||
uses: actions/checkout@master
|
||||
- name: Test Downstream
|
||||
uses: pulumi/action-test-provider-downstream@releases/v4
|
||||
uses: pulumi/action-test-provider-downstream@093f43c86c9b4820e1e3c80df8feab04868890f7
|
||||
env:
|
||||
GOPROXY: "https://proxy.golang.org"
|
||||
with:
|
||||
|
@ -99,16 +100,16 @@ jobs:
|
|||
with:
|
||||
python-version: 3.6.x
|
||||
- name: Install Pulumi CLI
|
||||
uses: pulumi/action-install-pulumi-cli@releases/v1
|
||||
uses: pulumi/action-install-pulumi-cli@b811287a6e06bb7e5d8b91132b839c67e3f9c6ed
|
||||
- name: Install pulumictl
|
||||
uses: jaxxstorm/action-install-gh-release@release/v1-alpha
|
||||
uses: jaxxstorm/action-install-gh-release@6277ebec57d2f9283d245d365f0b05bcc23d85e0
|
||||
with:
|
||||
repo: pulumi/pulumictl
|
||||
|
||||
- name: Check out source code
|
||||
uses: actions/checkout@master
|
||||
- name: Test Downstream
|
||||
uses: pulumi/action-test-provider-downstream@releases/v4
|
||||
uses: pulumi/action-test-provider-downstream@093f43c86c9b4820e1e3c80df8feab04868890f7
|
||||
env:
|
||||
GOPROXY: "https://proxy.golang.org"
|
||||
with:
|
||||
|
@ -136,16 +137,16 @@ jobs:
|
|||
with:
|
||||
python-version: 3.6.x
|
||||
- name: Install Pulumi CLI
|
||||
uses: pulumi/action-install-pulumi-cli@releases/v1
|
||||
uses: pulumi/action-install-pulumi-cli@b811287a6e06bb7e5d8b91132b839c67e3f9c6ed
|
||||
- name: Install pulumictl
|
||||
uses: jaxxstorm/action-install-gh-release@release/v1-alpha
|
||||
uses: jaxxstorm/action-install-gh-release@6277ebec57d2f9283d245d365f0b05bcc23d85e0
|
||||
with:
|
||||
repo: pulumi/pulumictl
|
||||
|
||||
- name: Check out source code
|
||||
uses: actions/checkout@master
|
||||
- name: Test Downstream
|
||||
uses: pulumi/action-test-provider-downstream@releases/v4
|
||||
uses: pulumi/action-test-provider-downstream@093f43c86c9b4820e1e3c80df8feab04868890f7
|
||||
env:
|
||||
GOPROXY: "https://proxy.golang.org"
|
||||
with:
|
||||
|
@ -173,16 +174,16 @@ jobs:
|
|||
with:
|
||||
python-version: 3.6.x
|
||||
- name: Install Pulumi CLI
|
||||
uses: pulumi/action-install-pulumi-cli@releases/v1
|
||||
uses: pulumi/action-install-pulumi-cli@b811287a6e06bb7e5d8b91132b839c67e3f9c6ed
|
||||
- name: Install pulumictl
|
||||
uses: jaxxstorm/action-install-gh-release@release/v1-alpha
|
||||
uses: jaxxstorm/action-install-gh-release@6277ebec57d2f9283d245d365f0b05bcc23d85e0
|
||||
with:
|
||||
repo: pulumi/pulumictl
|
||||
|
||||
- name: Check out source code
|
||||
uses: actions/checkout@master
|
||||
- name: Test Downstream
|
||||
uses: pulumi/action-test-provider-downstream@releases/v4
|
||||
uses: pulumi/action-test-provider-downstream@093f43c86c9b4820e1e3c80df8feab04868890f7
|
||||
env:
|
||||
GOPROXY: "https://proxy.golang.org"
|
||||
with:
|
||||
|
@ -210,16 +211,16 @@ jobs:
|
|||
with:
|
||||
python-version: 3.6.x
|
||||
- name: Install Pulumi CLI
|
||||
uses: pulumi/action-install-pulumi-cli@releases/v1
|
||||
uses: pulumi/action-install-pulumi-cli@b811287a6e06bb7e5d8b91132b839c67e3f9c6ed
|
||||
- name: Install pulumictl
|
||||
uses: jaxxstorm/action-install-gh-release@release/v1-alpha
|
||||
uses: jaxxstorm/action-install-gh-release@6277ebec57d2f9283d245d365f0b05bcc23d85e0
|
||||
with:
|
||||
repo: pulumi/pulumictl
|
||||
|
||||
- name: Check out source code
|
||||
uses: actions/checkout@master
|
||||
- name: Test Downstream
|
||||
uses: pulumi/action-test-provider-downstream@releases/v4
|
||||
uses: pulumi/action-test-provider-downstream@093f43c86c9b4820e1e3c80df8feab04868890f7
|
||||
env:
|
||||
GOPROXY: "https://proxy.golang.org"
|
||||
with:
|
||||
|
|
27
.github/workflows/container-build.yml
vendored
27
.github/workflows/container-build.yml
vendored
|
@ -7,6 +7,33 @@ env:
|
|||
VERSION: ${{ github.event.client_payload.ref }}
|
||||
|
||||
jobs:
|
||||
pulumi:
|
||||
name: pulumi image build
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build Pulumi Image
|
||||
uses: jaxxstorm/action-docker-build@e98e474ca0312b1a0300cdbf9357dd2df3c62c22
|
||||
with:
|
||||
repository: pulumi/pulumi
|
||||
username: "pulumibot"
|
||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||
dockerfile: docker/pulumi/Dockerfile
|
||||
additional-tags: ${{ env.VERSION }}
|
||||
tag-latest: true
|
||||
build-args: PULUMI_VERSION=${{ env.VERSION }}
|
||||
- name: Build Pulumi GitHub Actions Image
|
||||
uses: jaxxstorm/action-docker-build@e98e474ca0312b1a0300cdbf9357dd2df3c62c22
|
||||
with:
|
||||
repository: pulumi/pulumi
|
||||
username: "pulumibot"
|
||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||
dockerfile: docker/actions/Dockerfile
|
||||
additional-tags: ${{ env.VERSION }}
|
||||
tag-latest: true
|
||||
build-args: PULUMI_VERSION=${{ env.VERSION }}
|
||||
base:
|
||||
name: base sdk image build
|
||||
runs-on: ubuntu-latest
|
||||
|
|
29
.github/workflows/docs.yml
vendored
Normal file
29
.github/workflows/docs.yml
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
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 }}
|
190
.github/workflows/prerelease.yml
vendored
Normal file
190
.github/workflows/prerelease.yml
vendored
Normal file
|
@ -0,0 +1,190 @@
|
|||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*.*.*
|
||||
paths-ignore:
|
||||
- 'CHANGELOG.md'
|
||||
- 'README.md'
|
||||
env:
|
||||
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PULUMI_TEST_OWNER: "moolumi"
|
||||
GO111MODULE: "on"
|
||||
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
|
||||
|
||||
jobs:
|
||||
publish-sdks:
|
||||
name: Publish SDKs
|
||||
runs-on: ubuntu-latest
|
||||
needs: publish-binaries
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.14.x ]
|
||||
python-version: [ 3.7.x ]
|
||||
dotnet-version: [ 3.1.x ]
|
||||
node-version: [ 10.x ]
|
||||
language: [ "nodejs", "python", "dotnet" ]
|
||||
steps:
|
||||
- name: Set up Go ${{ matrix.go-version }}
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- 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@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
registry-url: https://registry.npmjs.org
|
||||
always-auth: true
|
||||
- name: Install pipenv
|
||||
uses: dschep/install-pipenv-action@v1
|
||||
- name: Install Twine
|
||||
run: python -m pip install pip twine
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v2
|
||||
- name: Fetch Tags
|
||||
run: |
|
||||
git fetch --quiet --prune --unshallow --tags
|
||||
- name: Update path
|
||||
run: |
|
||||
echo "::add-path::${{ runner.temp }}/opt/pulumi/bin"
|
||||
- name: Set Go Dep path
|
||||
run: |
|
||||
echo "::set-env name=PULUMI_GO_DEP_ROOT::$(dirname $(pwd))"
|
||||
- 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
|
||||
runs-on: macos-latest
|
||||
needs: build-and-test
|
||||
steps:
|
||||
- name: Set up Go ${{ matrix.go-version }}
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v2
|
||||
- name: Fetch Tags
|
||||
run: |
|
||||
git fetch --quiet --prune --unshallow --tags
|
||||
- name: Install pulumictl
|
||||
uses: jaxxstorm/action-install-gh-release@6277ebec57d2f9283d245d365f0b05bcc23d85e0
|
||||
with:
|
||||
repo: pulumi/pulumictl
|
||||
- name: Configure AWS Credentials
|
||||
uses: aws-actions/configure-aws-credentials@v1
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
aws-region: us-east-2
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
role-duration-seconds: 3600
|
||||
role-external-id: upload-pulumi-release
|
||||
role-session-name: pulumi@githubActions
|
||||
role-to-assume: ${{ secrets.AWS_UPLOAD_ROLE_ARN }}
|
||||
- name: Set PreRelease Version
|
||||
run: echo "::set-env name=GORELEASER_CURRENT_TAG::v$(pulumictl get version --language generic -o)"
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
with:
|
||||
version: latest
|
||||
args: -f .goreleaser.prerelease.yml --rm-dist
|
||||
lint:
|
||||
container: golangci/golangci-lint:latest
|
||||
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
|
||||
build-and-test:
|
||||
name: Build & Test
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [ ubuntu-latest, macos-latest ]
|
||||
go-version: [1.14.x]
|
||||
python-version: [ 3.7.x ]
|
||||
dotnet-version: [ 3.1.x ]
|
||||
node-version: [ 10.x ]
|
||||
runs-on: ${{ matrix.platform }}
|
||||
steps:
|
||||
- name: Set up Go ${{ matrix.go-version }}
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- 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@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Install pipenv
|
||||
uses: dschep/install-pipenv-action@v1
|
||||
- name: Setup git
|
||||
run: |
|
||||
git config --global user.email "you@example.com"
|
||||
git config --global user.name "Your Name"
|
||||
- name: Update path
|
||||
run: |
|
||||
echo "::add-path::${{ runner.temp }}/opt/pulumi/bin"
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v2
|
||||
- name: Fetch Tags
|
||||
run: |
|
||||
git fetch --quiet --prune --unshallow --tags
|
||||
- name: Set Go Dep path
|
||||
run: |
|
||||
echo "::set-env name=PULUMI_GO_DEP_ROOT::$(dirname $(pwd))"
|
||||
- name: Ensure
|
||||
run: |
|
||||
make ensure
|
||||
- name: Dist
|
||||
run: |
|
||||
make dist
|
||||
env:
|
||||
PULUMI_NODE_MODULES: ${{ runner.temp }}/opt/pulumi/node_modules
|
||||
PULUMI_LOCAL_NUGET: ${{ runner.temp }}/opt/pulumi/nuget
|
||||
PULUMI_ROOT: ${{ runner.temp }}/opt/pulumi
|
||||
- name: Install
|
||||
run: |
|
||||
make install_all
|
||||
env:
|
||||
PULUMI_NODE_MODULES: ${{ runner.temp }}/opt/pulumi/node_modules
|
||||
PULUMI_LOCAL_NUGET: ${{ runner.temp }}/opt/pulumi/nuget
|
||||
PULUMI_ROOT: ${{ runner.temp }}/opt/pulumi
|
||||
- name: Test
|
||||
run: |
|
||||
make test_all
|
||||
env:
|
||||
PULUMI_NODE_MODULES: ${{ runner.temp }}/opt/pulumi/node_modules
|
||||
PULUMI_LOCAL_NUGET: ${{ runner.temp }}/opt/pulumi/nuget
|
||||
PULUMI_ROOT: ${{ runner.temp }}/opt/pulumi
|
||||
|
||||
|
224
.github/workflows/release.yml
vendored
Normal file
224
.github/workflows/release.yml
vendored
Normal file
|
@ -0,0 +1,224 @@
|
|||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*.*.*
|
||||
paths-ignore:
|
||||
- 'CHANGELOG.md'
|
||||
- 'README.md'
|
||||
env:
|
||||
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PULUMI_TEST_OWNER: "moolumi"
|
||||
GO111MODULE: "on"
|
||||
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
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
name: Build Docker Images
|
||||
runs-on: ubuntu-latest
|
||||
needs: publish-sdks
|
||||
steps:
|
||||
- name: Repository Dispatch
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
token: ${{ secrets.PULUMI_BOT_TOKEN }}
|
||||
event-type: docker-build
|
||||
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
|
||||
docs:
|
||||
name: Build Package Docs
|
||||
runs-on: ubuntu-latest
|
||||
needs: publish-sdks
|
||||
steps:
|
||||
- name: Repository Dispatch
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
token: ${{ secrets.PULUMI_BOT_TOKEN }}
|
||||
event-type: homebrew-bump
|
||||
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
|
||||
homebrew:
|
||||
name: Update Homebrew
|
||||
runs-on: macos-latest
|
||||
needs: publish-sdks
|
||||
steps:
|
||||
- name: Repository Dispatch
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
token: ${{ secrets.PULUMI_BOT_TOKEN }}
|
||||
event-type: homebrew-bump
|
||||
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
|
||||
|
||||
publish-sdks:
|
||||
name: Publish SDKs
|
||||
runs-on: ubuntu-latest
|
||||
needs: publish-binaries
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 1.14.x ]
|
||||
python-version: [ 3.7.x ]
|
||||
dotnet-version: [ 3.1.x ]
|
||||
node-version: [ 10.x ]
|
||||
language: [ "nodejs", "python", "dotnet" ]
|
||||
steps:
|
||||
- name: Set up Go ${{ matrix.go-version }}
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- 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@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
registry-url: https://registry.npmjs.org
|
||||
always-auth: true
|
||||
- name: Install pipenv
|
||||
uses: dschep/install-pipenv-action@v1
|
||||
- name: Install Twine
|
||||
run: python -m pip install pip twine
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v2
|
||||
- name: Fetch Tags
|
||||
run: |
|
||||
git fetch --quiet --prune --unshallow --tags
|
||||
- name: Update path
|
||||
run: |
|
||||
echo "::add-path::${{ runner.temp }}/opt/pulumi/bin"
|
||||
- name: Set Go Dep path
|
||||
run: |
|
||||
echo "::set-env name=PULUMI_GO_DEP_ROOT::$(dirname $(pwd))"
|
||||
- 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
|
||||
runs-on: macos-latest
|
||||
needs: build-and-test
|
||||
steps:
|
||||
- name: Set up Go ${{ matrix.go-version }}
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v2
|
||||
- name: Fetch Tags
|
||||
run: |
|
||||
git fetch --quiet --prune --unshallow --tags
|
||||
- name: Install pulumictl
|
||||
uses: jaxxstorm/action-install-gh-release@6277ebec57d2f9283d245d365f0b05bcc23d85e0
|
||||
with:
|
||||
repo: pulumi/pulumictl
|
||||
- name: Configure AWS Credentials
|
||||
uses: aws-actions/configure-aws-credentials@v1
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
aws-region: us-east-2
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
role-duration-seconds: 3600
|
||||
role-external-id: upload-pulumi-release
|
||||
role-session-name: pulumi@githubActions
|
||||
role-to-assume: ${{ secrets.AWS_UPLOAD_ROLE_ARN }}
|
||||
- name: Set Release Version
|
||||
run: echo "::set-env name=GORELEASER_CURRENT_TAG::v$(pulumictl get version --language generic -o)"
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
with:
|
||||
version: latest
|
||||
args: -f .goreleaser.yml --rm-dist
|
||||
lint:
|
||||
container: golangci/golangci-lint:latest
|
||||
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
|
||||
build-and-test:
|
||||
name: Build & Test
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [ ubuntu-latest, macos-latest ]
|
||||
go-version: [1.14.x]
|
||||
python-version: [ 3.7.x ]
|
||||
dotnet-version: [ 3.1.x ]
|
||||
node-version: [ 10.x ]
|
||||
runs-on: ${{ matrix.platform }}
|
||||
steps:
|
||||
- name: Set up Go ${{ matrix.go-version }}
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- 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@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Install pipenv
|
||||
uses: dschep/install-pipenv-action@v1
|
||||
- name: Setup git
|
||||
run: |
|
||||
git config --global user.email "you@example.com"
|
||||
git config --global user.name "Your Name"
|
||||
- name: Update path
|
||||
run: |
|
||||
echo "::add-path::${{ runner.temp }}/opt/pulumi/bin"
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v2
|
||||
- name: Fetch Tags
|
||||
run: |
|
||||
git fetch --quiet --prune --unshallow --tags
|
||||
- name: Set Go Dep path
|
||||
run: |
|
||||
echo "::set-env name=PULUMI_GO_DEP_ROOT::$(dirname $(pwd))"
|
||||
- name: Ensure
|
||||
run: |
|
||||
make ensure
|
||||
- name: Dist
|
||||
run: |
|
||||
make dist
|
||||
env:
|
||||
PULUMI_NODE_MODULES: ${{ runner.temp }}/opt/pulumi/node_modules
|
||||
PULUMI_LOCAL_NUGET: ${{ runner.temp }}/opt/pulumi/nuget
|
||||
PULUMI_ROOT: ${{ runner.temp }}/opt/pulumi
|
||||
- name: Install
|
||||
run: |
|
||||
make install_all
|
||||
env:
|
||||
PULUMI_NODE_MODULES: ${{ runner.temp }}/opt/pulumi/node_modules
|
||||
PULUMI_LOCAL_NUGET: ${{ runner.temp }}/opt/pulumi/nuget
|
||||
PULUMI_ROOT: ${{ runner.temp }}/opt/pulumi
|
||||
- name: Test
|
||||
run: |
|
||||
make test_all
|
||||
env:
|
||||
PULUMI_NODE_MODULES: ${{ runner.temp }}/opt/pulumi/node_modules
|
||||
PULUMI_LOCAL_NUGET: ${{ runner.temp }}/opt/pulumi/nuget
|
||||
PULUMI_ROOT: ${{ runner.temp }}/opt/pulumi
|
||||
|
||||
|
8
.gitignore
vendored
8
.gitignore
vendored
|
@ -23,3 +23,11 @@ coverage.cov
|
|||
**/yarn.lock
|
||||
|
||||
.mypy_cache
|
||||
|
||||
# for goreleaser
|
||||
goreleaser
|
||||
pulumi-resource-pulumi-nodejs
|
||||
pulumi-resource-pulumi-python
|
||||
pulumi-analyzer-policy
|
||||
pulumi-analyzer-policy-python
|
||||
pulumi-language-python-exec
|
||||
|
|
|
@ -4,10 +4,7 @@ dist: goreleaser
|
|||
project_name: pulumi
|
||||
before:
|
||||
hooks:
|
||||
- cd sdk && go mod tidy
|
||||
- cd sdk && go mod download
|
||||
- cd pkg && go mod tidy
|
||||
- cd pkg && go mod download
|
||||
- ./scripts/prep-for-goreleaser.sh
|
||||
blobs:
|
||||
- bucket: get.pulumi.com
|
||||
folder: releases/sdk/
|
||||
|
@ -30,8 +27,8 @@ builds:
|
|||
goos:
|
||||
- linux
|
||||
- darwin
|
||||
ldflags:
|
||||
- github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
ldflags:
|
||||
- -X github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
main: ./cmd/pulumi
|
||||
- id: pulumi-language-nodejs-unix
|
||||
binary: pulumi-language-nodejs
|
||||
|
@ -42,7 +39,7 @@ builds:
|
|||
- linux
|
||||
- darwin
|
||||
ldflags:
|
||||
- github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
- -X github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
main: ./nodejs/cmd/pulumi-language-nodejs
|
||||
- id: pulumi-language-python-unix
|
||||
binary: pulumi-language-python
|
||||
|
@ -53,7 +50,7 @@ builds:
|
|||
- linux
|
||||
- darwin
|
||||
ldflags:
|
||||
- github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
- -X github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
main: ./python/cmd/pulumi-language-python
|
||||
- id: pulumi-language-dotnet-unix
|
||||
binary: pulumi-language-dotnet
|
||||
|
@ -64,7 +61,7 @@ builds:
|
|||
- linux
|
||||
- darwin
|
||||
ldflags:
|
||||
- github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
- -X github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
main: ./dotnet/cmd/pulumi-language-dotnet
|
||||
- id: pulumi-language-go-unix
|
||||
binary: pulumi-language-go
|
||||
|
@ -75,62 +72,12 @@ builds:
|
|||
- linux
|
||||
- darwin
|
||||
ldflags:
|
||||
- github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
- -X github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
main: ./go/pulumi-language-go
|
||||
|
||||
# Windows builds
|
||||
- id: pulumi-windows
|
||||
binary: pulumi
|
||||
dir: pkg
|
||||
goarch:
|
||||
- amd64
|
||||
goos:
|
||||
- windows
|
||||
ldflags:
|
||||
- github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
main: ./cmd/pulumi
|
||||
- id: pulumi-language-nodejs-windows
|
||||
binary: pulumi-language-nodejs
|
||||
dir: sdk
|
||||
goarch:
|
||||
- amd64
|
||||
goos:
|
||||
- windows
|
||||
ldflags:
|
||||
- github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
main: ./nodejs/cmd/pulumi-language-nodejs
|
||||
- id: pulumi-language-python-windows
|
||||
binary: pulumi-language-python
|
||||
dir: sdk
|
||||
goarch:
|
||||
- amd64
|
||||
goos:
|
||||
- windows
|
||||
ldflags:
|
||||
- github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
main: ./python/cmd/pulumi-language-python
|
||||
- id: pulumi-language-dotnet-windows
|
||||
binary: pulumi-language-dotnet
|
||||
dir: sdk
|
||||
goarch:
|
||||
- amd64
|
||||
goos:
|
||||
- windows
|
||||
ldflags:
|
||||
- github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
main: ./dotnet/cmd/pulumi-language-dotnet
|
||||
- id: pulumi-language-go-windows
|
||||
binary: pulumi-language-go
|
||||
dir: sdk
|
||||
goarch:
|
||||
- amd64
|
||||
goos:
|
||||
- windows
|
||||
ldflags:
|
||||
- github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
main: ./go/pulumi-language-go
|
||||
archives:
|
||||
- id: pulumi-unix
|
||||
wrap_in_directory: pulumi
|
||||
builds:
|
||||
- pulumi-language-dotnet-unix
|
||||
- pulumi-language-go-unix
|
||||
|
@ -140,30 +87,11 @@ archives:
|
|||
replacements:
|
||||
amd64: x64
|
||||
files:
|
||||
- sdk/nodejs/dist/pulumi-resource-pulumi-nodejs
|
||||
- sdk/python/dist/pulumi-resource-pulumi-python
|
||||
- sdk/nodejs/dist/pulumi-analyzer-policy
|
||||
- sdk/python/dist/pulumi-analyzer-policy-python
|
||||
- sdk/python/cmd/pulumi-language-python-exec
|
||||
name_template: "{{ .ProjectName }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
|
||||
- id: pulumi-windows
|
||||
builds:
|
||||
- pulumi-language-dotnet-windows
|
||||
- pulumi-language-go-windows
|
||||
- pulumi-language-python-windows
|
||||
- pulumi-language-nodejs-windows
|
||||
- pulumi-windows
|
||||
replacements:
|
||||
amd64: x64
|
||||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
files:
|
||||
- sdk/nodejs/dist/pulumi-resource-pulumi-nodejs.cmd
|
||||
- sdk/python/dist/pulumi-resource-pulumi-python.cmd
|
||||
- sdk/nodejs/dist/pulumi-analyzer-policy.cmd
|
||||
- sdk/python/dist/pulumi-analyzer-policy-python.cmd
|
||||
- sdk/python/cmd/pulumi-language-python-exec
|
||||
- pulumi-resource-pulumi-nodejs
|
||||
- pulumi-resource-pulumi-python
|
||||
- pulumi-analyzer-policy
|
||||
- pulumi-analyzer-policy-python
|
||||
- pulumi-language-python-exec
|
||||
name_template: "{{ .ProjectName }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
|
||||
snapshot:
|
||||
name_template: "{{ .Version }}-SNAPSHOT"
|
||||
|
|
106
.goreleaser.yml
106
.goreleaser.yml
|
@ -4,10 +4,16 @@ dist: goreleaser
|
|||
project_name: pulumi
|
||||
before:
|
||||
hooks:
|
||||
- cd sdk && go mod tidy
|
||||
- cd sdk && go mod download
|
||||
- cd pkg && go mod tidy
|
||||
- cd pkg && go mod download
|
||||
- ./scripts/prep-for-goreleaser.sh
|
||||
blobs:
|
||||
- bucket: get.pulumi.com
|
||||
folder: releases/sdk/
|
||||
ids:
|
||||
- pulumi-unix
|
||||
provider: s3
|
||||
region: us-west-2
|
||||
changelog:
|
||||
skip: true
|
||||
builds:
|
||||
# UNIX builds
|
||||
- id: pulumi-unix
|
||||
|
@ -19,7 +25,7 @@ builds:
|
|||
- linux
|
||||
- darwin
|
||||
ldflags:
|
||||
- github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
- -X github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
main: ./cmd/pulumi
|
||||
- id: pulumi-language-nodejs-unix
|
||||
binary: pulumi-language-nodejs
|
||||
|
@ -30,7 +36,7 @@ builds:
|
|||
- linux
|
||||
- darwin
|
||||
ldflags:
|
||||
- github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
- -X github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
main: ./nodejs/cmd/pulumi-language-nodejs
|
||||
- id: pulumi-language-python-unix
|
||||
binary: pulumi-language-python
|
||||
|
@ -41,7 +47,7 @@ builds:
|
|||
- linux
|
||||
- darwin
|
||||
ldflags:
|
||||
- github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
- -X github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
main: ./python/cmd/pulumi-language-python
|
||||
- id: pulumi-language-dotnet-unix
|
||||
binary: pulumi-language-dotnet
|
||||
|
@ -52,7 +58,7 @@ builds:
|
|||
- linux
|
||||
- darwin
|
||||
ldflags:
|
||||
- github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
- -X github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
main: ./dotnet/cmd/pulumi-language-dotnet
|
||||
- id: pulumi-language-go-unix
|
||||
binary: pulumi-language-go
|
||||
|
@ -63,62 +69,13 @@ builds:
|
|||
- linux
|
||||
- darwin
|
||||
ldflags:
|
||||
- github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
- -X github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
main: ./go/pulumi-language-go
|
||||
|
||||
# Windows builds
|
||||
#- id: pulumi-windows
|
||||
# binary: pulumi
|
||||
# dir: pkg
|
||||
# goarch:
|
||||
# - amd64
|
||||
# goos:
|
||||
# - windows
|
||||
# ldflags:
|
||||
# - github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
# main: ./cmd/pulumi
|
||||
#- id: pulumi-language-nodejs-windows
|
||||
# binary: pulumi-language-nodejs
|
||||
# dir: sdk
|
||||
# goarch:
|
||||
# - amd64
|
||||
# goos:
|
||||
# - windows
|
||||
# ldflags:
|
||||
# - github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
# main: ./nodejs/cmd/pulumi-language-nodejs
|
||||
#- id: pulumi-language-python-windows
|
||||
# binary: pulumi-language-python
|
||||
# dir: sdk
|
||||
# goarch:
|
||||
# - amd64
|
||||
# goos:
|
||||
# - windows
|
||||
# ldflags:
|
||||
# - github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
# main: ./python/cmd/pulumi-language-python
|
||||
#- id: pulumi-language-dotnet-windows
|
||||
# binary: pulumi-language-dotnet
|
||||
# dir: sdk
|
||||
# goarch:
|
||||
# - amd64
|
||||
# goos:
|
||||
# - windows
|
||||
# ldflags:
|
||||
# - github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
# main: ./dotnet/cmd/pulumi-language-dotnet
|
||||
#- id: pulumi-language-go-windows
|
||||
# binary: pulumi-language-go
|
||||
# dir: sdk
|
||||
# goarch:
|
||||
# - amd64
|
||||
# goos:
|
||||
# - windows
|
||||
# ldflags:
|
||||
# - github.com/pulumi/pulumi/pkg/v2/version.Version={{.Tag}}
|
||||
# main: ./go/pulumi-language-go
|
||||
|
||||
archives:
|
||||
- id: pulumi-unix
|
||||
wrap_in_directory: "pulumi"
|
||||
builds:
|
||||
- pulumi-language-dotnet-unix
|
||||
- pulumi-language-go-unix
|
||||
|
@ -128,31 +85,12 @@ archives:
|
|||
replacements:
|
||||
amd64: x64
|
||||
files:
|
||||
- sdk/nodejs/dist/pulumi-resource-pulumi-nodejs
|
||||
- sdk/python/dist/pulumi-resource-pulumi-python
|
||||
- sdk/nodejs/dist/pulumi-analyzer-policy
|
||||
- sdk/python/dist/pulumi-analyzer-policy-python
|
||||
- sdk/python/cmd/pulumi-language-python-exec
|
||||
- pulumi-resource-pulumi-nodejs
|
||||
- pulumi-resource-pulumi-python
|
||||
- pulumi-analyzer-policy
|
||||
- pulumi-analyzer-policy-python
|
||||
- pulumi-language-python-exec
|
||||
name_template: "{{ .ProjectName }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
|
||||
#- id: pulumi-windows
|
||||
# builds:
|
||||
# - pulumi-language-dotnet-windows
|
||||
# - pulumi-language-go-windows
|
||||
# - pulumi-language-python-windows
|
||||
# - pulumi-language-nodejs-windows
|
||||
# - pulumi-windows
|
||||
# replacements:
|
||||
# amd64: x64
|
||||
# format_overrides:
|
||||
# - goos: windows
|
||||
# format: zip
|
||||
# files:
|
||||
# - sdk/nodejs/dist/pulumi-resource-pulumi-nodejs.cmd
|
||||
# - sdk/python/dist/pulumi-resource-pulumi-python.cmd
|
||||
# - sdk/nodejs/dist/pulumi-analyzer-policy.cmd
|
||||
# - sdk/python/dist/pulumi-analyzer-policy-python.cmd
|
||||
# - sdk/python/cmd/pulumi-language-python-exec
|
||||
# name_template: "{{ .ProjectName }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
|
||||
snapshot:
|
||||
name_template: "{{ .Version }}-SNAPSHOT"
|
||||
checksum:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if: branch = master OR branch =~ ^features/ OR branch =~ ^feature- OR branch =~ ^feature/ OR tag =~ ^v\d+.*
|
||||
if: tag =~ ^v\d+.*
|
||||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
|
|
|
@ -69,9 +69,9 @@ func TestInvalidPolicyPackTemplateName(t *testing.T) {
|
|||
|
||||
t.Run("RemoteTemplateNotFound", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
tempdir, e := ioutil.TempDir("", "test-env")
|
||||
t.Log(e)
|
||||
tempdir, _ := ioutil.TempDir("", "test-env")
|
||||
defer os.RemoveAll(tempdir)
|
||||
assert.DirExists(t, tempdir)
|
||||
assert.NoError(t, os.Chdir(tempdir))
|
||||
|
||||
var args = newPolicyArgs{
|
||||
|
|
18
scripts/prep-for-goreleaser.sh
Executable file
18
scripts/prep-for-goreleaser.sh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
|
||||
pushd sdk
|
||||
go mod tidy
|
||||
go mod download
|
||||
popd
|
||||
|
||||
pushd pkg
|
||||
go mod tidy
|
||||
go mod download
|
||||
popd
|
||||
|
||||
cp sdk/nodejs/dist/pulumi-resource-pulumi-nodejs .
|
||||
cp sdk/nodejs/dist/pulumi-resource-pulumi-nodejs .
|
||||
cp sdk/python/dist/pulumi-resource-pulumi-python .
|
||||
cp sdk/nodejs/dist/pulumi-analyzer-policy .
|
||||
cp sdk/python/dist/pulumi-analyzer-policy-python .
|
||||
cp sdk/python/cmd/pulumi-language-python-exec .
|
|
@ -23,6 +23,10 @@ if [[ "${TRAVIS_PUBLISH_PACKAGES:-}" == "true" ]]; then
|
|||
# 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}" != *-beta* ]]; then
|
||||
NPM_TAG="beta"
|
||||
fi
|
||||
|
||||
if [[ "${PKG_VERSION}" != *-alpha* ]]; then
|
||||
NPM_TAG="latest"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue