Bridge terraform-provider-dokploy into a Pulumi provider
18 resources and 5 data sources mapped into the dokploy:index module, with SDKs generated for TypeScript, Python, Go and .NET.
This commit is contained in:
121
.github/workflows/release.yml
vendored
Normal file
121
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*.*.*"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
env:
|
||||
GO_VERSION: "1.25.x"
|
||||
NODE_VERSION: "20.x"
|
||||
PYTHON_VERSION: "3.11"
|
||||
DOTNET_VERSION: "8.0.x"
|
||||
UPSTREAM_REPO: maxvojtkov/terraform-provider-dokploy
|
||||
UPSTREAM_DIR: dokploy-teraform
|
||||
|
||||
jobs:
|
||||
# Publishes the plugin binaries. Pulumi resolves them from this release via
|
||||
# the provider's `github://api.github.com/maxvojtkov/pulumi-dokploy` URL.
|
||||
plugin:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: pulumi-dokploy
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ env.UPSTREAM_REPO }}
|
||||
path: ${{ env.UPSTREAM_DIR }}
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- uses: goreleaser/goreleaser-action@v6
|
||||
with:
|
||||
version: latest
|
||||
args: release --clean
|
||||
workdir: pulumi-dokploy
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
sdks:
|
||||
needs: plugin
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: pulumi-dokploy
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ env.UPSTREAM_REPO }}
|
||||
path: ${{ env.UPSTREAM_DIR }}
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
registry-url: https://registry.npmjs.org
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
|
||||
- uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
||||
|
||||
- name: Derive version from tag
|
||||
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Build SDKs
|
||||
working-directory: pulumi-dokploy
|
||||
run: make build_sdks VERSION=${{ env.VERSION }}
|
||||
|
||||
- name: Publish to npm
|
||||
working-directory: pulumi-dokploy/sdk/nodejs/bin
|
||||
run: npm publish --access public
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Publish to PyPI
|
||||
working-directory: pulumi-dokploy/sdk/python
|
||||
run: |
|
||||
python -m pip install --upgrade build twine
|
||||
python -m build
|
||||
python -m twine upload dist/*
|
||||
env:
|
||||
TWINE_USERNAME: __token__
|
||||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
||||
|
||||
- name: Publish to NuGet
|
||||
working-directory: pulumi-dokploy/sdk/dotnet
|
||||
run: |
|
||||
dotnet pack --configuration Release --output ./nupkg
|
||||
dotnet nuget push ./nupkg/*.nupkg \
|
||||
--source https://api.nuget.org/v3/index.json \
|
||||
--api-key "$NUGET_PUBLISH_KEY" --skip-duplicate
|
||||
env:
|
||||
NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }}
|
||||
|
||||
# Go modules are consumed straight from the repository, so the generated
|
||||
# SDK has to be committed and tagged as `sdk/vX.Y.Z`.
|
||||
- name: Commit and tag the Go SDK
|
||||
working-directory: pulumi-dokploy
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add sdk provider/cmd/pulumi-resource-dokploy/schema.json \
|
||||
provider/cmd/pulumi-resource-dokploy/bridge-metadata.json
|
||||
git diff --cached --quiet || git commit -m "chore: SDKs for v${{ env.VERSION }}"
|
||||
git tag "sdk/v${{ env.VERSION }}"
|
||||
git push origin HEAD:main --tags
|
||||
Reference in New Issue
Block a user