Skip to content

Commit 0cc48b0

Browse files
chore: add logic for auto-release
1 parent daf8c24 commit 0cc48b0

File tree

11 files changed

+637
-33
lines changed

11 files changed

+637
-33
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: Release New Version
1+
name: Release New SDK Version
22
on:
33
workflow_dispatch:
44
inputs:
55
version:
6-
description: "The version to release"
6+
description: "The version to release. Do not include the v prefix."
77
required: false
88
default: ""
99

@@ -12,11 +12,12 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
env:
15-
SVU_VERSION: "3.3.3"
15+
SVU_VERSION: "3.3.0"
1616

1717
permissions:
1818
contents: write
1919
id-token: write
20+
packages: write
2021

2122
jobs:
2223
build-with-latest-hapi-release:
@@ -38,6 +39,13 @@ jobs:
3839
cache: "npm"
3940
registry-url: "https://npm.pkg.github.com"
4041

42+
- name: Prevent Post-Install Scripts
43+
run: |
44+
npm config set ignore-scripts true
45+
46+
- name: Install Dependencies
47+
run: npm install -g socket && npx socket npm ci
48+
4149
- name: Setup Copywrite
4250
uses: hashicorp/[email protected]
4351

@@ -74,17 +82,19 @@ jobs:
7482

7583
- name: Get svu
7684
run: |
77-
URL="https://github.com/caarlos0/svu/releases/download/v${SVU_VERSION}/svu_${SVU_VERSION}_linux_amd64.tar.gz"
78-
wget --quiet $URL --output-document svu.tar.gz
79-
tar -xzf svu.tar.gz
80-
chmod +x svu
81-
sudo mv svu /usr/local/bin/
85+
tmpdir=$(mktemp -d)
86+
URL="https://github.com/caarlos0/svu/releases/download/v${{ env.SVU_VERSION }}/svu_${{ env.SVU_VERSION }}_linux_amd64.tar.gz"
87+
wget --quiet "$URL" --output-document "$tmpdir/svu.tar.gz"
88+
tar -xzf "$tmpdir/svu.tar.gz" -C "$tmpdir"
89+
sudo install "$tmpdir/svu" /usr/local/bin/
90+
rm -rf "$tmpdir"
8291
svu --version
8392
8493
- id: tag
94+
name: Determine Version to Release
95+
env:
96+
INPUT_VERSION: ${{ github.event.inputs.version }}
8597
run: |
86-
INPUT_VERSION="${{ github.event.inputs.version }}"
87-
8898
if [ -n "$INPUT_VERSION" ]; then
8999
echo "Using provided version: $INPUT_VERSION"
90100
VERSION="$INPUT_VERSION"
@@ -130,13 +140,22 @@ jobs:
130140
131141
- name: Set package version
132142
if: steps.tag.outputs.SAME_VERSION != 'true'
133-
run: npm version ${{ steps.tag.outputs.NPM_VERSION }} --no-git-tag-version
143+
env:
144+
NPM_VERSION: ${{ steps.tag.outputs.NPM_VERSION }}
145+
run: npm version "$NPM_VERSION" --no-git-tag-version
134146

135147
- name: Publish to npm
136148
if: steps.tag.outputs.SAME_VERSION != 'true'
137149
run: npm publish
138150
env:
139-
NODE_AUTH_TOKEN: ${{ steps.import-secrets.outputs.VAULT_GITHUB_TOKEN }}
151+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
152+
153+
- name: Create GitHub Release
154+
if: steps.tag.outputs.SAME_VERSION != 'true'
155+
env:
156+
GH_TOKEN: ${{ steps.import-secrets.outputs.VAULT_GITHUB_TOKEN }}
157+
VERSION: ${{ steps.tag.outputs.VERSION }}
158+
run: gh release create "$VERSION" --generate-notes
140159

141160
- name: Commit reviewable diff
142161
if: steps.tag.outputs.SAME_VERSION != 'true'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ yarn-error.log*
3131

3232
# Credentials
3333
.netrc
34+
.npmrc
3435

3536
# OS generated files
3637
.DS_Store

.npmrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
registry=https://registry.npmjs.org/
21
@spectrocloud:registry=https://npm.pkg.github.com
32
access=public
43
ignore-scripts=true

api/palette-apis-spec-fixed.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2979,10 +2979,21 @@
29792979
],
29802980
"type": "string"
29812981
},
2982+
"hostResourceGroupArn": {
2983+
"description": "ARN of AWS Host Resource Group for node placement on dedicated hosts",
2984+
"type": "string"
2985+
},
29822986
"instanceType": {
29832987
"description": "instance type",
29842988
"type": "string"
29852989
},
2990+
"licenseConfigurationArns": {
2991+
"description": "List of AWS License Configuration ARNs (required when hostResourceGroupArn is specified)",
2992+
"items": {
2993+
"type": "string"
2994+
},
2995+
"type": "array"
2996+
},
29862997
"rootDeviceSize": {
29872998
"description": "rootDeviceSize in GBs",
29882999
"format": "int64",
@@ -3045,6 +3056,10 @@
30453056
],
30463057
"type": "string"
30473058
},
3059+
"hostResourceGroupArn": {
3060+
"description": "ARN of AWS Host Resource Group for node placement on dedicated hosts",
3061+
"type": "string"
3062+
},
30483063
"instanceConfig": {
30493064
"$ref": "#/definitions/v1InstanceConfig"
30503065
},
@@ -3064,6 +3079,13 @@
30643079
},
30653080
"type": "array"
30663081
},
3082+
"licenseConfigurationArns": {
3083+
"description": "List of AWS License Configuration ARNs (required when hostResourceGroupArn is specified)",
3084+
"items": {
3085+
"type": "string"
3086+
},
3087+
"type": "array"
3088+
},
30673089
"machinePoolProperties": {
30683090
"$ref": "#/definitions/v1MachinePoolProperties"
30693091
},

api/palette-apis-spec-tagged.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2979,10 +2979,21 @@
29792979
],
29802980
"type": "string"
29812981
},
2982+
"hostResourceGroupArn": {
2983+
"description": "ARN of AWS Host Resource Group for node placement on dedicated hosts",
2984+
"type": "string"
2985+
},
29822986
"instanceType": {
29832987
"description": "instance type",
29842988
"type": "string"
29852989
},
2990+
"licenseConfigurationArns": {
2991+
"description": "List of AWS License Configuration ARNs (required when hostResourceGroupArn is specified)",
2992+
"items": {
2993+
"type": "string"
2994+
},
2995+
"type": "array"
2996+
},
29862997
"rootDeviceSize": {
29872998
"description": "rootDeviceSize in GBs",
29882999
"format": "int64",
@@ -3045,6 +3056,10 @@
30453056
],
30463057
"type": "string"
30473058
},
3059+
"hostResourceGroupArn": {
3060+
"description": "ARN of AWS Host Resource Group for node placement on dedicated hosts",
3061+
"type": "string"
3062+
},
30483063
"instanceConfig": {
30493064
"$ref": "#/definitions/v1InstanceConfig"
30503065
},
@@ -3064,6 +3079,13 @@
30643079
},
30653080
"type": "array"
30663081
},
3082+
"licenseConfigurationArns": {
3083+
"description": "List of AWS License Configuration ARNs (required when hostResourceGroupArn is specified)",
3084+
"items": {
3085+
"type": "string"
3086+
},
3087+
"type": "array"
3088+
},
30673089
"machinePoolProperties": {
30683090
"$ref": "#/definitions/v1MachinePoolProperties"
30693091
},

api/palette-apis-spec.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)