ci: updated CI issues #138
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release to Production | |
on: | |
push: | |
branches: [ main ] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
darwin-amd64: | |
name: darwin-amd64 | |
runs-on: ubuntu-latest | |
outputs: | |
VERSION: ${{ steps.go.outputs.version }} | |
env: | |
GOARCH: amd64 | |
GOOS: darwin | |
steps: | |
- | |
id: go | |
name: "Set up Go 1.20" | |
uses: actions/setup-go@v4.0.0 | |
with: | |
go-version: 1.20 | |
- | |
name: "Check out code into the Go module directory" | |
uses: actions/checkout@v3 | |
- | |
name: "Get dependencies" | |
id: dependencies | |
run: | | |
go get -v -t -d ./... | |
if [ -f Gopkg.toml ]; then | |
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | |
dep ensure | |
fi | |
npm ci | |
npx semantic-release --dry-run | |
cat VERSION.env | |
source VERSION.env | |
echo "::set-output name=version::$VERSION" | |
- | |
name: create | |
run: go build -ldflags="-X 'github.com/karl-cardenas-coding/disaster-cli/cmd.VersionString=${{steps.dependencies.outputs.VERSION}}'" -o=disaster -v && zip disaster-v${{steps.dependencies.outputs.VERSION}}-${{env.GOOS}}-${{env.GOARCH}}.zip disaster | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: disaster-v${{steps.dependencies.outputs.VERSION}}-${{env.GOOS}}-${{env.GOARCH}}.zip | |
path: disaster-v${{steps.dependencies.outputs.VERSION}}-${{env.GOOS}}-${{env.GOARCH}}.zip | |
darwin-arm64: | |
name: darwin-amd64 | |
runs-on: ubuntu-latest | |
outputs: | |
VERSION: ${{ steps.go.outputs.version }} | |
env: | |
GOARCH: arm64 | |
GOOS: darwin | |
steps: | |
- | |
id: go | |
name: "Set up Go 1.20" | |
uses: actions/setup-go@v4.0.0 | |
with: | |
go-version: 1.20 | |
- | |
name: "Check out code into the Go module directory" | |
uses: actions/checkout@v2 | |
- | |
name: "Get dependencies" | |
id: dependencies | |
run: | | |
go get -v -t -d ./... | |
if [ -f Gopkg.toml ]; then | |
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | |
dep ensure | |
fi | |
npm ci | |
npm install @semantic-release/exec -D | |
npx semantic-release --dry-run | |
cat VERSION.env | |
source VERSION.env | |
echo "::set-output name=version::$VERSION" | |
- | |
name: create | |
run: go build -ldflags="-X 'github.com/karl-cardenas-coding/disaster-cli/cmd.VersionString=${{steps.dependencies.outputs.VERSION}}'" -o=disaster -v && zip disaster-v${{steps.dependencies.outputs.VERSION}}-${{env.GOOS}}-${{env.GOARCH}}.zip disaster | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: disaster-v${{steps.dependencies.outputs.VERSION}}-${{env.GOOS}}-${{env.GOARCH}}.zip | |
path: disaster-v${{steps.dependencies.outputs.VERSION}}-${{env.GOOS}}-${{env.GOARCH}}.zip | |
linux-386: | |
name: linux-386 | |
runs-on: ubuntu-latest | |
outputs: | |
VERSION: ${{ steps.go.outputs.version }} | |
env: | |
GOARCH: "386" | |
GOOS: linux | |
steps: | |
- | |
id: go | |
name: "Set up Go 1.20" | |
uses: actions/setup-go@v4.0.0 | |
with: | |
go-version: 1.20 | |
- | |
name: "Check out code into the Go module directory" | |
uses: actions/checkout@v2 | |
- | |
name: "Get dependencies" | |
id: dependencies | |
run: | | |
go get -v -t -d ./... | |
if [ -f Gopkg.toml ]; then | |
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | |
dep ensure | |
fi | |
npm install | |
npm install @semantic-release/exec -D | |
npx semantic-release --dry-run | |
cat VERSION.env | |
source VERSION.env | |
echo "::set-output name=version::$VERSION" | |
- | |
name: create | |
run: go build -ldflags="-X 'github.com/karl-cardenas-coding/disaster-cli/cmd.VersionString=${{steps.dependencies.outputs.VERSION}}'" -o=disaster -v && zip disaster-v${{steps.dependencies.outputs.VERSION}}-${{env.GOOS}}-${{env.GOARCH}}.zip disaster | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: disaster-v${{steps.dependencies.outputs.VERSION}}-${{env.GOOS}}-${{env.GOARCH}}.zip | |
path: disaster-v${{steps.dependencies.outputs.VERSION}}-${{env.GOOS}}-${{env.GOARCH}}.zip | |
linux-amd64: | |
name: linux-amd64 | |
runs-on: ubuntu-latest | |
outputs: | |
VERSION: ${{ steps.go.outputs.version }} | |
env: | |
GOARCH: amd64 | |
GOOS: linux | |
steps: | |
- | |
id: go | |
name: "Set up Go" | |
uses: actions/setup-go@v4.0.0 | |
with: | |
go-version: 1.20 | |
- | |
name: "Check out code into the Go module directory" | |
uses: actions/checkout@v2 | |
- | |
name: "Get dependencies" | |
id: dependencies | |
run: | | |
go get -v -t -d ./... | |
if [ -f Gopkg.toml ]; then | |
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | |
dep ensure | |
fi | |
npm install | |
npm install @semantic-release/exec -D | |
npx semantic-release --dry-run | |
cat VERSION.env | |
source VERSION.env | |
echo "::set-output name=version::$VERSION" | |
- | |
name: create | |
run: go build -ldflags="-X 'github.com/karl-cardenas-coding/disaster-cli/cmd.VersionString=v${{steps.dependencies.outputs.VERSION}}'" -o=disaster -v && zip disaster-v${{steps.dependencies.outputs.VERSION}}-${{env.GOOS}}-${{env.GOARCH}}.zip disaster | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: disaster-v${{steps.dependencies.outputs.VERSION}}-${{env.GOOS}}-${{env.GOARCH}}.zip | |
path: disaster-v${{steps.dependencies.outputs.VERSION}}-${{env.GOOS}}-${{env.GOARCH}}.zip | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: VERSION.env | |
path: VERSION.env | |
windows-amd64: | |
name: windows-amd64 | |
runs-on: ubuntu-latest | |
outputs: | |
VERSION: ${{ steps.go.outputs.version }} | |
env: | |
GOARCH: amd64 | |
GOOS: windows | |
steps: | |
- | |
id: go | |
name: "Set up Go 1.20" | |
uses: actions/setup-go@v4.0.0 | |
with: | |
go-version: 1.20 | |
- | |
name: "Check out code into the Go module directory" | |
uses: actions/checkout@v2 | |
- | |
name: "Get dependencies" | |
id: dependencies | |
run: | | |
go get -v -t -d ./... | |
if [ -f Gopkg.toml ]; then | |
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | |
dep ensure | |
fi | |
npm install | |
npm install @semantic-release/exec -D | |
npx semantic-release --dry-run | |
cat VERSION.env | |
source VERSION.env | |
echo "::set-output name=version::$VERSION" | |
- | |
name: create | |
run: go build -ldflags="-X 'github.com/karl-cardenas-coding/disaster-cli/cmd.VersionString=${{steps.dependencies.outputs.VERSION}}'" -o=disaster.exe -v && zip disaster-v${{steps.dependencies.outputs.VERSION}}-${{env.GOOS}}-${{env.GOARCH}}.zip disaster.exe | |
- uses: actions/upload-artifact@v1 | |
with: | |
name: disaster-v${{steps.dependencies.outputs.VERSION}}-${{env.GOOS}}-${{env.GOARCH}}.zip | |
path: disaster-v${{steps.dependencies.outputs.VERSION}}-${{env.GOOS}}-${{env.GOARCH}}.zip | |
release: | |
name: "Create a release" | |
needs: ["darwin-amd64", "linux-386", "linux-amd64", "windows-amd64", "darwin-arm64"] | |
runs-on: ubuntu-latest | |
outputs: | |
VERSION: ${{ steps.get-version.outputs.version }} | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v1 | |
with: | |
name: VERSION.env | |
path: ./ | |
- name: Get Version | |
id: get-version | |
run: | | |
source VERSION.env | |
echo $VERSION | |
echo "::set-output name=version::$VERSION" | |
- uses: actions/download-artifact@v1 | |
with: | |
name: disaster-v${{ steps.get-version.outputs.version }}-darwin-amd64.zip | |
path: ./ | |
- uses: actions/download-artifact@v1 | |
with: | |
name: disaster-v${{ steps.get-version.outputs.version }}-linux-386.zip | |
path: ./ | |
- uses: actions/download-artifact@v1 | |
with: | |
name: disaster-v${{ steps.get-version.outputs.version }}-linux-amd64.zip | |
path: ./ | |
- uses: actions/download-artifact@v1 | |
with: | |
name: disaster-v${{ steps.get-version.outputs.version }}-windows-amd64.zip | |
path: ./ | |
- name: "release" | |
run: | | |
npm install | |
npm install @semantic-release/exec -D | |
npx semantic-release |