make tfgen (#12) #26
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
tags: | |
- v*.*.* | |
permissions: | |
contents: write | |
env: | |
# THIS GITHUB_TOKEN IS A REQUIREMENT TO BE ABLE TO WRITE TO GH RELEASES | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# IF YOU NEED TO PUBLISH A NPM PACKAGE THEN ENSURE A NPM_TOKEN SECRET IS SET | |
# AND PUBLISH_NPM: TRUE. IF YOU WANT TO PUBLISH TO A PRIVATE NPM REGISTRY | |
# THEN ENSURE THE NPM_REGISTRY_URL IS CHANGED | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
PUBLISH_NPM: true | |
NPM_REGISTRY_URL: https://registry.npmjs.org | |
# IF YOU NEED TO PUBLISH A NUGET PACKAGE THEN ENSURE AN NUGET_PUBLISH_KEY | |
# SECRET IS SET AND PUBLISH_NUGET: TRUE. IF YOU WANT TO PUBLISH TO AN ALTERNATIVE | |
# NPM REGISTRY THEN ENSURE THE NPM_REGISTRY_URL IS CHANGED | |
NUGET_PUBLISH_KEY: ${{ secrets.NUGET_TOKEN }} | |
NUGET_FEED_URL: https://api.nuget.org/v3/index.json | |
PUBLISH_NUGET: true | |
# IF YOU NEED TO PUBLISH A PYPI PACKAGE THEN ENSURE AN PYPI_API_TOKEN | |
# SECRET IS SET AND PUBLISH_PYPI: TRUE. IF YOU WANT TO PUBLISH TO AN ALTERNATIVE | |
# PYPI REGISTRY THEN ENSURE THE PYPI_REPOSITORY_URL IS SET. IF YOU ARE USING AN API_TOKEN THEN | |
# YOU DO NOT NEED TO CHANGE THE PYPI_USERNAME (__token__) , IF YOU ARE USING PASSWORD AUTHENTICATION THEN YOU WILL | |
# NEED TO CHANGE TO USE THE CORRECT PASSWORD | |
PYPI_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
PYPI_USERNAME: "__token__" | |
PYPI_REPOSITORY_URL: "" | |
PUBLISH_PYPI: true | |
PROVIDER: stripe | |
jobs: | |
prerequisites: | |
name: prerequisites | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Checkout Scripts Repo | |
uses: actions/checkout@v3 | |
with: | |
path: ci-scripts | |
repository: pulumi/scripts | |
- name: Unshallow clone for tags | |
run: git fetch --prune --unshallow --tags | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{matrix.goversion}} | |
cache-dependency-path: | | |
sdk/go.sum | |
- name: Install pulumictl | |
uses: jaxxstorm/[email protected] | |
with: | |
repo: pulumi/pulumictl | |
- name: Setup Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{matrix.nodeversion}} | |
registry-url: https://registry.npmjs.org | |
- name: Install Pulumi CLI | |
uses: pulumi/action-install-pulumi-cli@v2 | |
- if: github.event_name == 'pull_request' | |
name: Install Schema Tools | |
uses: jaxxstorm/[email protected] | |
with: | |
repo: mikhailshilkov/schema-tools | |
- name: Clear GitHub Actions Ubuntu runner disk space | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: false | |
dotnet: false | |
android: true | |
haskell: true | |
swap-storage: true | |
# TODO: enable once transient error with azure is resolved | |
# E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/universe/d/dotnet7/aspnetcore-targeting-pack-7.0_7.0.105-0ubuntu1%7e22.04.1_amd64.deb 404 Not Found [IP: 40.81.13.82 80] | |
large-packages: false | |
- name: Build tfgen & provider binaries | |
run: make provider | |
- name: Tar provider binaries | |
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ | |
github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }} | |
pulumi-tfgen-${{ env.PROVIDER }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ env.PROVIDER }}-provider.tar.gz | |
path: ${{ github.workspace }}/bin/provider.tar.gz | |
strategy: | |
fail-fast: true | |
matrix: | |
goversion: | |
- 1.21.x | |
nodeversion: | |
- 16.x | |
pythonversion: | |
- "3.9" | |
publish_binary: | |
name: publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- name: Unshallow clone for tags | |
run: git fetch --prune --unshallow --tags | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{matrix.goversion}} | |
- name: Install pulumictl | |
uses: jaxxstorm/[email protected] | |
with: | |
repo: pulumi/pulumictl | |
- name: Set PreRelease Version | |
run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" >> $GITHUB_ENV | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v2 | |
with: | |
args: -p 3 release --rm-dist | |
version: latest | |
strategy: | |
fail-fast: true | |
matrix: | |
goversion: | |
- 1.21.x | |
build_sdk: | |
name: build_sdk | |
runs-on: ubuntu-latest | |
needs: prerequisites | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Checkout Scripts Repo | |
uses: actions/checkout@v3 | |
with: | |
path: ci-scripts | |
repository: pulumi/scripts | |
- name: Unshallow clone for tags | |
run: git fetch --prune --unshallow --tags | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{matrix.goversion}} | |
cache-dependency-path: | | |
sdk/go.sum | |
- name: Install pulumictl | |
uses: jaxxstorm/[email protected] | |
with: | |
repo: pulumi/pulumictl | |
- name: Install Pulumi CLI | |
uses: pulumi/action-install-pulumi-cli@v2 | |
- name: Setup Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{matrix.nodeversion}} | |
registry-url: https://registry.npmjs.org | |
- name: Setup DotNet | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: ${{ env.DOTNETVERSION }} | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{matrix.pythonversion}} | |
- name: Download provider + tfgen binaries | |
uses: actions/download-artifact@v2 | |
with: | |
name: ${{ env.PROVIDER }}-provider.tar.gz | |
path: ${{ github.workspace }}/bin | |
- name: Untar provider binaries | |
run: >- | |
tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ | |
github.workspace}}/bin | |
find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \; | |
- name: Install plugins | |
run: make install_plugins | |
- name: Update path | |
run: echo "${{ github.workspace }}/bin" >> $GITHUB_PATH | |
- name: Set PACKAGE_VERSION to Env | |
run: echo "PACKAGE_VERSION=$(pulumictl get version --language generic)" >> | |
$GITHUB_ENV | |
- name: Build SDK | |
run: make build_${{ matrix.language }} | |
- name: Check worktree clean | |
run: ./ci-scripts/ci/check-worktree-is-clean | |
- name: Compress SDK folder | |
run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ matrix.language }}-sdk.tar.gz | |
path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz | |
strategy: | |
fail-fast: true | |
matrix: | |
goversion: | |
- 1.21.x | |
language: | |
- nodejs | |
- python | |
- dotnet | |
- go | |
nodeversion: | |
- 16.x | |
pythonversion: | |
- "3.9" | |
publish_sdk: | |
name: Publish SDKs | |
runs-on: ubuntu-latest | |
needs: | |
- publish_binary | |
- build_sdk | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Create directory for untarring | |
run: mkdir -p ${{ github.workspace }}/sdk/${{ matrix.language }} | |
- name: Publish SDKs | |
uses: ./.github/actions/pulumi-publish | |
with: | |
sdk: ${{ matrix.language }} | |
strategy: | |
fail-fast: true | |
matrix: | |
dotnetversion: | |
- 3.1.301 | |
goversion: | |
- 1.21.x | |
language: | |
- nodejs | |
- python | |
- dotnet | |
- go | |
nodeversion: | |
- 16.x | |
pythonversion: | |
- "3.9" |