Skip to content

Release

Release #16

Workflow file for this run

name: Release
on:
workflow_dispatch:
release:
types: [published]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_REGISTRY_URL: https://registry.npmjs.org
NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }}
NUGET_FEED_URL: https://api.nuget.org/v3/index.json
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
PYPI_USERNAME: "__token__"
jobs:
publish_binary:
name: publish
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{matrix.goversion}}
- name: Install pulumictl
uses: jaxxstorm/action-install-gh-release@v1.11.0
with:
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: pulumi/action-install-pulumi-cli@v2.0.0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{matrix.nodeversion}}
registry-url: ${{env.NPM_REGISTRY_URL}}
- name: Setup DotNet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{matrix.dotnetversion}}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{matrix.pythonversion}}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
args: -p 3 release --rm-dist
version: latest
- name: Checkout Repo
uses: actions/checkout@v4
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Generate SDK
run: make build
- name: Get current tag
id: get_tag
run: echo "::set-output name=tag::${GITHUB_REF##*/}"
- name: Create new tag
id: create_tag
uses: mathieudutour/github-tag-action@v5
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: sdk/${{ steps.get_tag.outputs.tag }}
tag_prefix: ""
- name: Compress SDK folder
run: |
for language in nodejs python dotnet go; do
tar -zcf sdk/$language.tar.gz -C sdk/$language .
done
- name: Upload artifacts
uses: skx/github-action-publish-binaries@release-0.14
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
releaseId: ${{ github.event.release.id }}
args: "./sdk/*.tar.gz"
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: ${{ env.PYPI_USERNAME }}
password: ${{ env.PYPI_PASSWORD }}
packages-dir: ${{github.workspace}}/sdk/python/bin/dist
- name: Publish NPM package
uses: JS-DevTools/npm-publish@v3
with:
access: "public"
token: ${{ env.NPM_TOKEN }}
package: ${{github.workspace}}/sdk/nodejs/bin/package.json
- name: publish nuget package
run: |
dotnet nuget push ${{github.workspace}}/sdk/dotnet/bin/Debug/*.nupkg -s ${{ env.NUGET_FEED_URL }} -k ${{ env.NUGET_PUBLISH_KEY }}
echo "done publishing packages"
strategy:
fail-fast: true
matrix:
dotnetversion:
- 6.0.x
goversion:
- 1.20.x
nodeversion:
- 21.x
pythonversion:
- "3.9"