Refactor shared services, split project.go, fix config defaults #3
Workflow file for this run
This file contains hidden or 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 | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| - name: Run tests | |
| run: go test ./... | |
| - name: Build binaries | |
| run: | | |
| VERSION=${GITHUB_REF_NAME} | |
| BUILD_TIME=$(date -u '+%Y-%m-%dT%H:%M:%SZ') | |
| LDFLAGS="-s -w -X github.com/ScaleCommerce-DEV/scdev/cmd.Version=${VERSION} -X github.com/ScaleCommerce-DEV/scdev/cmd.BuildTime=${BUILD_TIME}" | |
| GOOS=darwin GOARCH=arm64 go build -ldflags "${LDFLAGS}" -o scdev-darwin-arm64 . | |
| GOOS=darwin GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o scdev-darwin-amd64 . | |
| CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "${LDFLAGS}" -o scdev-linux-amd64 . | |
| CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "${LDFLAGS}" -o scdev-linux-arm64 . | |
| - name: Build release body | |
| run: | | |
| cat > release-body.md << 'HEADER' | |
| ## Install | |
| **macOS / Linux:** | |
| ```bash | |
| curl -fsSL https://raw.githubusercontent.com/ScaleCommerce-DEV/scdev/main/install.sh | sh | |
| ``` | |
| HEADER | |
| # Extract the latest version section from CHANGELOG.md | |
| if [ -f CHANGELOG.md ]; then | |
| echo "---" >> release-body.md | |
| echo "" >> release-body.md | |
| awk '/^## /{if(found) exit; found=1; next} found{print}' CHANGELOG.md >> release-body.md | |
| fi | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body_path: release-body.md | |
| files: | | |
| scdev-darwin-arm64 | |
| scdev-darwin-amd64 | |
| scdev-linux-amd64 | |
| scdev-linux-arm64 |