Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/pr_release_validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: PR Release Validation

on:
pull_request:
branches:
- main
workflow_dispatch:

permissions:
contents: read

jobs:
test-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.24.1
cache: true

- name: Download Go dependencies
run: |
echo "Downloading Go modules..."
go mod download
echo "Go modules downloaded successfully"

- name: Install osslsigncode
run: |
sudo apt-get update
sudo apt-get install -y osslsigncode

- name: Generate self-signed test certificates
run: |
# Generate a private key
openssl genrsa -out test-key.pem 2048

# Generate a self-signed certificate
openssl req -new -x509 -key test-key.pem -out test-cert.pem -days 1 \
-subj "/C=US/ST=Test/L=Test/O=SailPoint Test/CN=SailPoint CLI Test"

# Export paths
echo "CERT_FILE=$(pwd)/test-cert.pem" >> $GITHUB_ENV
echo "KEY_FILE=$(pwd)/test-key.pem" >> $GITHUB_ENV

- name: Set test version
run: echo "RELEASE_VERSION=0.0.0-test" >> $GITHUB_ENV

- name: Run GoReleaser in Snapshot Mode
uses: goreleaser/goreleaser-action@v6
with:
version: "2.8.2"
args: release --snapshot --clean --skip=publish --timeout 30m --config .goreleaser.test.yaml --parallelism 4
env:
GORELEASER_CURRENT_TAG: "v0.0.0-test"
CERT_PASSWORD: "test"

- name: Upload artifacts for inspection
uses: actions/upload-artifact@v4
with:
name: test-release-artifacts
path: dist/
retention-days: 7

15 changes: 12 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:

jobs:
goreleaser:
runs-on: macOS-15
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -32,14 +32,23 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: 1.24.1
cache: true

- name: Download Go dependencies
run: |
echo "Downloading Go modules..."
go mod download
echo "Go modules downloaded successfully"

- name: Set Tag Name
id: tagName
run: |
echo "tag-name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Install osslsigncode
run: brew install osslsigncode
run: |
sudo apt-get update
sudo apt-get install -y osslsigncode

- name: Obtain signing cert
run: |
Expand All @@ -64,7 +73,7 @@ jobs:
uses: goreleaser/goreleaser-action@v6
with:
version: "2.8.2"
args: release --clean --verbose --timeout 60m
args: release --clean --verbose --timeout 60m --parallelism 4
env:
GITHUB_TOKEN: ${{secrets.PUBLISHER_TOKEN}}
GORELEASER_CURRENT_TAG: ${{steps.tagName.outputs.tag-name}}
Expand Down
84 changes: 84 additions & 0 deletions .goreleaser.test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
project_name: sail

version: 2

release:
prerelease: auto
draft: true
name_template: "SailPoint CLI {{.Version}}"

before:
hooks:
- go mod tidy

builds:
- id: windows
goos: [windows]
goarch: ['386', amd64, arm64] # All Windows architectures
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X main.version={{ .Version }}
hooks:
post:
- cmd: ./assets/sign-windows-executable.sh '{{ .Path }}'
output: true

- id: linux
goos: [linux]
goarch: ['386', arm, amd64, arm64] # All common Linux architectures
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X main.version={{ .Version }}

- id: macos
binary: bin/sail
main: ./
goos: [darwin]
goarch: [amd64, arm64]
ldflags:
- -s -w -X main.version={{ .Version }}

archives:
- id: nix
ids: [macos, linux]
name_template: >-
{{- .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end -}}
wrap_in_directory: true
formats: tar.gz
files:
- LICENSE

- id: windows
ids: [windows]
formats: zip
wrap_in_directory: false
files:
- LICENSE

brews:
- name: sailpoint-cli
homepage: "https://github.com/sailpoint-oss/sailpoint-cli"
repository:
name: homebrew-tap
owner: sailpoint-oss
commit_author:
name: developer-relations-sp
email: devrel-service@sailpoint.com

nfpms:
- license: MIT
maintainer: SailPoint
homepage: https://github.com/sailpoint-oss/sailpoint-cli
bindir: /usr
description: The SailPoint Command Line Interface.
formats:
- deb
- rpm

7 changes: 2 additions & 5 deletions cmd/connector/conn_tag_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,9 @@ func newConnTagUpdateCmd(client client.Client) *cobra.Command {
tagName := cmd.Flags().Lookup("name").Value.String()
versionStr := cmd.Flags().Lookup("version").Value.String()

version, err := strconv.Atoi(versionStr)
version, err := strconv.ParseUint(versionStr, 10, 32)
if err != nil {
return err
}
if version < 0 || version > int(math.MaxUint32) {
return fmt.Errorf("active version must be between 0 and %d", math.MaxUint32)
return fmt.Errorf("active version must be a valid number between 0 and %d", uint32(math.MaxUint32))
}
raw, err := json.Marshal(TagUpdate{ActiveVersion: uint32(version)})
if err != nil {
Expand Down
Loading