generated from pulumi/pulumi-tf-provider-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
115 lines (114 loc) · 3.58 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: release
on:
push:
tags:
- v*.*.*
env:
# THIS GITHUB_TOKEN IS A REQUIREMENT TO BE ABLE TO WRITE TO GH RELEASES
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# IF YOU NEED TO PUBLISH A NPM PACKAGE THEN ENSURE A NPM_TOKEN SECRET IS SET
# AND PUBLISH_NPM: TRUE. IF YOU WANT TO PUBLISH TO A PRIVATE NPM REGISTRY
# THEN ENSURE THE NPM_REGISTRY_URL IS CHANGED
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
PUBLISH_NPM: true
NPM_REGISTRY_URL: https://registry.npmjs.org
# IF YOU NEED TO PUBLISH A NUGET PACKAGE THEN ENSURE AN NUGET_PUBLISH_KEY
# SECRET IS SET AND PUBLISH_NUGET: TRUE. IF YOU WANT TO PUBLISH TO AN ALTERNATIVE
# NPM REGISTRY THEN ENSURE THE NPM_REGISTRY_URL IS CHANGED
# NUGET_PUBLISH_KEY: ${{ YOUR NUGET PUBLISH KEY HERE }}
# NUGET_FEED_URL: https://api.nuget.org/v3/index.json
# PUBLISH_NUGET: true
# IF YOU NEED TO PUBLISH A PYPI PACKAGE SET PUBLISH_PYPI: TRUE AND CHANGE PYPI_PASSWORD, PYPI_USERNAME TO YOUR CREDENTIALS.
# IF YOU WANT TO PUBLISH TO AN ALTERNATIVE PYPI REGISTRY THEN ENSURE THE PYPI_REPOSITORY_URL IS SET.
# PYPI_PASSWORD: ${{ YOUR PYPI PASSWORD HERE }}
# PYPI_USERNAME: "YOUR PYPI USERNAME HERE"
# PYPI_REPOSITORY_URL: ""
# PUBLISH_PYPI: true
jobs:
publish_binary:
name: publish
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{matrix.goversion}}
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Set PreRelease Version
run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" >> $GITHUB_ENV
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
args: -p 3 release --clean
version: latest
strategy:
fail-fast: true
matrix:
goversion:
- 1.21.x
build_sdk:
name: Build SDKs
runs-on: ubuntu-latest
outputs:
version: ${{ steps.provider-version.outputs.version }}
strategy:
fail-fast: true
matrix:
language:
- nodejs
# - go
# - dotnet
# - python
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-tags: true
- uses: pulumi/provider-version-action@v1
id: provider-version
- name: Install devbox
uses: jetify-com/[email protected]
with:
enable-cache: true
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build SDK
run: devbox run -- make build_${{ matrix.language }}
- name: Upload SDK
uses: ./.github/actions/upload-sdk
with:
language: ${{ matrix.language }}
publish_sdk:
name: Publish SDKs
runs-on: ubuntu-latest
needs: build_sdk
env:
VERSION: ${{ needs.build_sdk.outputs.version }}
steps:
- name: Publish SDKs
uses: pulumi/[email protected]
with:
version: ${{ needs.build_sdk.outputs.version }}
strategy:
fail-fast: true
matrix:
sdk:
- nodejs
# - python
# - dotnet
# - go