Skip to content

Commit

Permalink
Create release (#2)
Browse files Browse the repository at this point in the history
* Update readme

* Add release github action
  • Loading branch information
Jonne authored Dec 18, 2020
1 parent 9f4d2be commit ce23572
Show file tree
Hide file tree
Showing 3 changed files with 326 additions and 51 deletions.
267 changes: 267 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: "on"
PROVIDER: commercetools
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }}
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TRAVIS_OS_NAME: linux
jobs:
build_sdk:
name: build_sdk
needs: prerequisites
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Checkout Scripts Repo
uses: actions/checkout@v2
with:
path: ci-scripts
repository: pulumi/scripts
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: pulumi/[email protected]
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{matrix.nodeversion}}
registry-url: https://registry.npmjs.org
- name: Setup DotNet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{matrix.dotnetverson}}
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{matrix.pythonversion}}
- name: Download provider + tfgen binaries
uses: actions/download-artifact@v2
with:
name: ${{ env.PROVIDER }}-provider.tar.gz
path: ${{ github.workspace }}/bin
- name: Untar provider binaries
run: tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace
}}/bin
- name: Restore binary perms
run: find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print
-exec chmod +x {} \;
- name: Build SDK
run: make build_${{ matrix.language }}
- name: Check worktree clean
run: ./ci-scripts/ci/check-worktree-is-clean
- name: Compress SDK folder
run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }}
.
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.language }}-sdk.tar.gz
path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz
strategy:
fail-fast: true
matrix:
dotnetversion:
- 3.1.301
goversion:
- 1.15.x
language:
- nodejs
- python
- dotnet
- go
nodeversion:
- 13.x
pythonversion:
- "3.7"
prerequisites:
name: prerequisites
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Checkout Scripts Repo
uses: actions/checkout@v2
with:
path: ci-scripts
repository: pulumi/scripts
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: pulumi/[email protected]
- name: Build tfgen & provider binaries
run: sudo make provider
- name: Tar provider binaries
run: sudo tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace
}}/bin/ pulumi-resource-${{ env.PROVIDER }} pulumi-tfgen-${{ env.PROVIDER
}}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ env.PROVIDER }}-provider.tar.gz
path: ${{ github.workspace }}/bin/provider.tar.gz
strategy:
fail-fast: true
lint:
container: golangci/golangci-lint:latest
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Checkout Scripts Repo
uses: actions/checkout@v2
with:
path: ci-scripts
repository: pulumi/scripts
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: pulumi/[email protected]
- name: Run golangci
run: make lint_provider
strategy:
fail-fast: true
lint_sdk:
container: golangci/golangci-lint:latest
name: lint-sdk
needs: build_sdk
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Checkout Scripts Repo
uses: actions/checkout@v2
with:
path: ci-scripts
repository: pulumi/scripts
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: pulumi/[email protected]
- name: Run golangci
run: cd sdk/go/commercetools && golangci-lint run -c ../../../.golangci.yml
strategy:
fail-fast: true
publish:
needs: build_sdk
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Checkout Scripts Repo
uses: actions/checkout@v2
with:
path: ci-scripts
repository: pulumi/scripts
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
args: -p 4 release --rm-dist
version: latest
publish_sdk:
name: publish_sdk
needs: publish
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Checkout Scripts Repo
uses: actions/checkout@v2
with:
path: ci-scripts
repository: pulumi/scripts
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15.x
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: pulumi/[email protected]
- name: Setup Node
uses: actions/setup-node@v1
with:
always-auth: true
registry-url: https://registry.npmjs.org
- name: Setup DotNet
uses: actions/setup-dotnet@v1
- name: Setup Python
uses: actions/setup-python@v2
- name: Download Python SDK
uses: actions/download-artifact@v2
with:
name: python-sdk.tar.gz
path: ${{ github.workspace}}/sdk
- name: Unzip Python SDK
run: tar -zxf ${{ github.workspace}}/sdk/python.tar.gz -C ${{ github.workspace}}/sdk/python
- name: Install Twine
run: python -m pip install pip twine
- name: Download NodeJS SDK
uses: actions/download-artifact@v2
with:
name: nodejs-sdk.tar.gz
path: ${{ github.workspace}}/sdk
- name: Unzip NodeJS SDK
run: tar -zxf ${{ github.workspace}}/sdk/nodejs.tar.gz -C ${{ github.workspace}}/sdk/nodejs
- name: Download DotNet SDK
uses: actions/download-artifact@v2
with:
name: dotnet-sdk.tar.gz
path: ${{ github.workspace}}/sdk
- name: Unzip DotNet SDK
run: tar -zxf ${{ github.workspace}}/sdk/dotnet.tar.gz -C ${{ github.workspace}}/sdk/dotnet
- env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
name: Publish SDKs
run: ./ci-scripts/ci/publish-tfgen-package ${{ github.workspace }}
strategy:
fail-fast: true
name: release
"on":
push:
tags:
- v*.*.*
27 changes: 27 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
archives:
- id: archive
name_template: '{{ .Binary }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}'
before:
hooks:
- make tfgen
builds:
- binary: pulumi-resource-commercetools
dir: provider
env:
- CGO_ENABLED=0
- GO111MODULE=on
goarch:
- amd64
goos:
- darwin
- windows
- linux
ldflags:
- -X github.com/unplatform-io/pulumi-commercetools/provider/v3/pkg/version.Version={{.Tag}}
main: ./cmd/pulumi-resource-commercetools/
changelog:
skip: true
release:
disable: false
snapshot:
name_template: '{{ .Tag }}-SNAPSHOT'
Loading

0 comments on commit ce23572

Please sign in to comment.