Release #21
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: | |
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: 1.20.x | |
- name: Install pulumictl | |
uses: jaxxstorm/[email protected] | |
with: | |
repo: pulumi/pulumictl | |
- name: Install Pulumi CLI | |
uses: pulumi/[email protected] | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 21.x | |
registry-url: ${{env.NPM_REGISTRY_URL}} | |
- name: Setup DotNet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 6.0.x | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.9" | |
# - name: Run GoReleaser | |
# uses: goreleaser/goreleaser-action@v5 | |
# with: | |
# args: -p 3 release --clean | |
# 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: Create new tag | |
id: create_tag | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
custom_tag: sdk/${{ github.event.release.tag_name }} | |
tag_prefix: "" | |
release_branches: main | |
- 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/[email protected] | |
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 |