updated ci from pypi and nuget #25
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 | |
jobs: | |
goreleaser: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.21.x' | |
- name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@v5.2.0 | |
id: import_gpg | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.PASSPHRASE }} | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | |
publish_sdk: | |
name: Publish SDKs | |
runs-on: ubuntu-latest | |
needs: goreleaser | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
registry-url: https://registry.npmjs.org | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '6.0.x' | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.21.x' | |
- name: Get Version | |
id: get_version | |
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v} | |
- name: Build and Publish Node.js SDK | |
working-directory: ./sdk/nodejs | |
run: | | |
npm install | |
sed -i 's/"name": "@pgEdge\/pulumi-pgedge"/"name": "@pgedge\/pulumi-pgedge"/g' package.json | |
npm version ${{ steps.get_version.outputs.VERSION }} --no-git-tag-version | |
npm run build | |
npm publish --access=public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Build and Publish Python SDK | |
working-directory: ./sdk/python | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install build twine | |
python -m build | |
python -m twine upload dist/* | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
- name: Build and Publish .NET SDK | |
working-directory: ./sdk/dotnet | |
run: | | |
dotnet build | |
dotnet pack -o out | |
dotnet nuget push out/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN }} | |
env: | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
DOTNET_NOLOGO: true |