Skip to content

Commit e45d819

Browse files
authored
Merge pull request #32 from pulumiverse/adopt-pulumi-ci-mgmt
Adopt pulumi/ci-mgmt for Github Actions workflow automation
2 parents 54e55d8 + 93a0a68 commit e45d819

File tree

317 files changed

+3831
-1325
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

317 files changed

+3831
-1325
lines changed

.ci-mgmt.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
template: external-bridged-provider
2+
provider: zitadel
3+
organization: pulumiverse
4+
major-version: 0
5+
providerDefaultBranch: main
6+
upstreamProviderOrg: zitadel
7+
publishRegistry: false
8+
plugins:
9+
- name: terraform
10+
version: "1.0.19"
11+
kind: converter
12+
- name: random
13+
version: "4.16.7"
14+
languages:
15+
- dotnet
16+
- go
17+
- nodejs
18+
- python
19+
publish:
20+
sdk: "all,!java"
21+
cdn: false
22+
# license:
23+
# ignore:
24+
# Don't check for the license of the local shim package
25+
pulumiConvert: 1

.devcontainer/Dockerfile

Lines changed: 8 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,12 @@
1-
ARG UBUNTU_VERSION=latest
2-
FROM ubuntu:${UBUNTU_VERSION}
1+
FROM jetpackio/devbox:latest
32

4-
# Update apt-get and install various needed utilities
5-
RUN apt-get update && \
6-
apt-get install -y curl && \
7-
apt-get install -y wget && \
8-
apt-get install -y xz-utils && \
9-
apt-get install -y make && \
10-
apt-get install -y gcc && \
11-
apt-get install -y git
3+
# Installing your devbox project
4+
WORKDIR /code
5+
COPY devbox.json devbox.json
6+
COPY devbox.lock devbox.lock
7+
RUN sudo chown -R "${DEVBOX_USER}:${DEVBOX_USER}" /code
128

13-
# Install bridged provider prerequisites
14-
# See README.md
159

16-
# Install go
17-
ARG GO_VERSION=1.21.1
18-
RUN rm -rf /usr/local/go && \
19-
wget -O ${GO_VERSION}.tar.gz https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz && \
20-
tar -C /usr/local -xzf ${GO_VERSION}.tar.gz && \
21-
rm ${GO_VERSION}.tar.gz
10+
RUN devbox run -- echo "Installed Packages."
2211

23-
ENV GOPATH=/root/go
24-
ENV PATH=$PATH:/usr/local/go/bin
25-
26-
# Install go linter
27-
RUN mkdir -p $GOPATH/bin && \
28-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $GOPATH/bin v1.46.2
29-
30-
ENV PATH=$PATH:$GOPATH/bin
31-
32-
# Install pulumictl
33-
ARG PULUMICTL_VERSION=v0.0.32
34-
RUN rm -rf /usr/local/bin/pulumictl && \
35-
wget -O pulumictl.${PULUMICTL_VERSION}.tar.gz https://github.com/pulumi/pulumictl/releases/download/${PULUMICTL_VERSION}/pulumictl-${PULUMICTL_VERSION}-linux-amd64.tar.gz && \
36-
tar -C /usr/local/bin -xzf pulumictl.${PULUMICTL_VERSION}.tar.gz
37-
38-
# Install nodejs
39-
ARG NODEJS_VERSION=v20.11.1
40-
ARG NODEJS_PKG=node-${NODEJS_VERSION}-linux-x64
41-
ARG NODEJS_TARBALL=${NODEJS_PKG}.tar.xz
42-
RUN rm -rf /usr/local/node && \
43-
wget -O ${NODEJS_TARBALL} https://nodejs.org/dist/${NODEJS_VERSION}/${NODEJS_TARBALL} && \
44-
tar -C /usr/local -xf ${NODEJS_TARBALL} && \
45-
mv /usr/local/${NODEJS_PKG} /usr/local/node
46-
47-
ENV PATH=$PATH:/usr/local/node/bin
48-
49-
# Install yarn
50-
RUN npm install --global yarn
51-
52-
# Install python and related items
53-
RUN apt-get install -y python3 && \
54-
apt-get install -y python3-setuptools
55-
56-
# Install .NET
57-
# https://stackoverflow.com/questions/73753672/a-fatal-error-occurred-the-folder-usr-share-dotnet-host-fxr-does-not-exist
58-
RUN apt-get remove dotnet* && \
59-
apt-get remove aspnetcore* && \
60-
apt-get remove netstandard&
61-
62-
RUN apt-get update && \
63-
apt-get install dotnet-sdk-6.0 -y
64-
65-
# Install Pulumi
66-
RUN curl -fsSL https://get.pulumi.com | sh
67-
ENV PATH=$PATH:/root/.pulumi/bin
12+
RUN devbox shellenv --init-hook >> ~/.profile

.devcontainer/devcontainer.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2-
// https://github.com/microsoft/vscode-dev-containers/tree/v0.202.3/containers/hugo
31
{
4-
"name": "TFProvider",
2+
"name": "Devbox Remote Container",
53
"build": {
6-
"dockerfile": "Dockerfile"
7-
}
4+
"dockerfile": "./Dockerfile",
5+
"context": ".."
6+
},
7+
"customizations": {
8+
"vscode": {
9+
"settings": {},
10+
"extensions": [
11+
"jetpack-io.devbox"
12+
]
13+
}
14+
},
15+
"remoteUser": "devbox"
816
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sdk/**/* linguist-generated=true
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Download the code generator binary
2+
description: Downloads the code generator binary to `bin/`.
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Download the prerequisites bin
8+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
9+
with:
10+
name: prerequisites-bin
11+
path: bin
12+
13+
- name: Restore executable permissions
14+
shell: bash
15+
run: chmod +x $(< bin/executables.txt)
16+
17+
- name: Remove executables list
18+
shell: bash
19+
run: rm bin/executables.txt
20+
21+
- name: Download schema-embed.json
22+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
23+
with:
24+
# Use a pattern to avoid failing if the artifact doesn't exist
25+
pattern: schema-embed.*
26+
# Avoid creating directories for each artifact
27+
merge-multiple: true
28+
path: provider/cmd/pulumi-resource-zitadel
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Download the provider binary
2+
description: Downloads the provider binary to `bin/`.
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
8+
- name: Download pulumi-resource-zitadel
9+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
10+
with:
11+
pattern: pulumi-resource-zitadel-*-linux-amd64.tar.gz
12+
path: ${{ github.workspace }}/bin
13+
merge-multiple: true
14+
15+
- name: Untar pulumi-resource-zitadel
16+
shell: bash
17+
run: |
18+
tar -zxf ${{ github.workspace }}/bin/*amd64.tar.gz -C ${{ github.workspace}}/bin
19+
20+
- name: Mark pulumi-resource-zitadel as executable
21+
shell: bash
22+
run: |
23+
find ${{ github.workspace }} -name "pulumi-*-zitadel" -print -exec chmod +x {} \;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Download SDK asset
2+
description: Restores the SDK asset for a language.
3+
4+
inputs:
5+
language:
6+
required: true
7+
description: One of nodejs, python, dotnet, go, java
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: Download ${{ inputs.language }} SDK
13+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
14+
with:
15+
name: ${{ inputs.language }}-sdk.tar.gz
16+
path: ${{ github.workspace}}/sdk/
17+
- name: Uncompress SDK folder
18+
shell: bash
19+
run: tar -zxf ${{ github.workspace }}/sdk/${{ inputs.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ inputs.language }}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Setup tools
2+
description: Installs Go, Pulumi, pulumictl, schema-tools, Node.JS, Python, dotnet and Java.
3+
4+
inputs:
5+
tools:
6+
description: |
7+
Comma separated list of tools to install. The default of "all" installs all tools. Available tools are:
8+
go
9+
pulumicli
10+
pulumictl
11+
schema-tools
12+
nodejs
13+
python
14+
dotnet
15+
java
16+
default: all
17+
cache-go:
18+
description: |
19+
Whether to enable the GitHub cache for Go. Appropriate for disabling in
20+
smaller jobs that typically completely before the "real" job has an
21+
opportunity to populate the cache.
22+
default: "true"
23+
24+
runs:
25+
using: "composite"
26+
steps:
27+
- name: Install Go
28+
if: inputs.tools == 'all' || contains(inputs.tools, 'go')
29+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5
30+
with:
31+
go-version: "1.21.x"
32+
cache-dependency-path: |
33+
provider/*.sum
34+
upstream/*.sum
35+
sdk/go/*.sum
36+
sdk/*.sum
37+
*.sum
38+
# TODO(https://github.com/actions/setup-go/issues/316): Restore but don't save the cache.
39+
cache: ${{ inputs.cache-go }}
40+
41+
- name: Install pulumictl
42+
if: inputs.tools == 'all' || contains(inputs.tools, 'pulumictl')
43+
uses: jaxxstorm/action-install-gh-release@cd6b2b78ad38bdd294341cda064ec0692b06215b # v1.14.0
44+
with:
45+
tag: v0.0.46
46+
repo: pulumi/pulumictl
47+
48+
- name: Install Pulumi CLI
49+
if: inputs.tools == 'all' || contains(inputs.tools, 'pulumicli')
50+
uses: pulumi/actions@13b8b7177d6fb736766875dac9b78aab07bd785f # v6
51+
with:
52+
pulumi-version: "dev"
53+
54+
- name: Install Schema Tools
55+
if: inputs.tools == 'all' || contains(inputs.tools, 'schema-tools')
56+
uses: jaxxstorm/action-install-gh-release@cd6b2b78ad38bdd294341cda064ec0692b06215b # v1.14.0
57+
with:
58+
repo: pulumi/schema-tools
59+
60+
- name: Setup Node
61+
if: inputs.tools == 'all' || contains(inputs.tools, 'nodejs')
62+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
63+
with:
64+
node-version: 20.x
65+
registry-url: https://registry.npmjs.org
66+
67+
- name: Setup DotNet
68+
if: inputs.tools == 'all' || contains(inputs.tools, 'dotnet')
69+
uses: actions/setup-dotnet@3951f0dfe7a07e2313ec93c75700083e2005cbab # v4.3.0
70+
with:
71+
dotnet-version: 6.0.x
72+
73+
- name: Setup Python
74+
if: inputs.tools == 'all' || contains(inputs.tools, 'python')
75+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
76+
with:
77+
python-version: 3.11.8
78+
79+
- name: Setup Java
80+
if: inputs.tools == 'all' || contains(inputs.tools, 'java')
81+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
82+
with:
83+
cache: gradle
84+
distribution: temurin
85+
java-version: 11
86+
87+
- name: Setup Gradle
88+
if: inputs.tools == 'all' || contains(inputs.tools, 'java')
89+
uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3
90+
with:
91+
gradle-version: 7.6
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Upload SDK asset
2+
description: Upload the SDK for a specific language as an asset for the workflow.
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Capture executable permissions
8+
shell: bash
9+
run: find bin -type f -executable > bin/executables.txt
10+
11+
- name: Upload prerequisites bin
12+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
13+
with:
14+
name: prerequisites-bin
15+
path: bin/*
16+
retention-days: 30
17+
18+
- name: Upload schema-embed.json
19+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
20+
with:
21+
name: schema-embed.json
22+
path: provider/cmd/pulumi-resource-zitadel/schema-embed.json
23+
retention-days: 30
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Upload SDK asset
2+
description: Upload the SDK for a specific language as an asset for the workflow.
3+
4+
inputs:
5+
language:
6+
required: true
7+
description: One of nodejs, python, dotnet, go, java
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: Compress SDK folder
13+
shell: bash
14+
run: tar -zcf sdk/${{ inputs.language }}.tar.gz -C sdk/${{ inputs.language }} .
15+
- name: Upload artifacts
16+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
17+
with:
18+
name: ${{ inputs.language }}-sdk.tar.gz
19+
path: ${{ github.workspace}}/sdk/${{ inputs.language }}.tar.gz
20+
retention-days: 30

0 commit comments

Comments
 (0)