Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to goreleaser to build our provider #53

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
35 changes: 9 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- 'v*'
workflow_dispatch: # This is needed to trigger the workflow manually


jobs:
release:
name: 🚀 Release new pulumi provider version
Expand Down Expand Up @@ -42,26 +41,17 @@ jobs:
- name: Print pulumictl version
run: pulumictl get version

- name: Build provider
run: make provider
env:
PROVIDER_OS: ${{ matrix.provider_os }}

- name: Create package directory
run: |
mkdir -p package/arm64 package/amd64
mv bin/pulumi-resource-*amd64* package/amd64/pulumi-resource-spacelift
mv bin/pulumi-resource-*arm64* package/arm64/pulumi-resource-spacelift
- name: Set PreRelease Version
run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" >> $GITHUB_ENV

- name: Create package
run: |
cd package/amd64
tar -zcvf pulumi-resource-spacelift-${{ github.ref_name }}-${{matrix.provider_os}}-amd64.tar.gz pulumi-resource-*
cd ../arm64
tar -zcvf pulumi-resource-spacelift-${{ github.ref_name }}-${{matrix.provider_os}}-arm64.tar.gz pulumi-resource-*
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
args: -p 3 release --rm-dist
version: latest

- name: Create upload directory
run: mkdir -p upload/pulumi-plugins && mv package/*/*.tar.gz upload/pulumi-plugins/ && ls -la upload/pulumi-plugins/
run: mkdir -p upload/pulumi-plugins && mv dist/*/*.tar.gz upload/pulumi-plugins/ && ls -la upload/pulumi-plugins/

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
Expand All @@ -80,11 +70,4 @@ jobs:
run: >-
aws cloudfront create-invalidation
--distribution-id ${{ secrets.DISTRIBUTION }}
--paths "/*"

strategy:
matrix:
provider_os:
- darwin
- linux
- windows
--paths "/*"
24 changes: 24 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
archives:
- id: archive
name_template: "{{ .Binary }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
before:
hooks:
- make tfgen
builds:
- binary: pulumi-resource-spacelift
dir: provider
goarch:
- amd64
- arm64
goos:
- darwin
- windows
- linux
ignore: []
ldflags:
- -X github.com/spacelift-io/pulumi-spacelift/provider/pkg/version.Version={{.Tag}}
main: ./cmd/pulumi-resource-spacelift/
release:
disable: false
snapshot:
name_template: "{{ .Tag }}-SNAPSHOT"
Loading
Loading