Skip to content

Commit

Permalink
Merge pull request #5 from priyashpatil/fix/ci-build
Browse files Browse the repository at this point in the history
Fix/ci build
  • Loading branch information
priyashpatil authored Oct 17, 2024
2 parents a67cd12 + e2d9bd4 commit 9649378
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 29 deletions.
29 changes: 6 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,19 @@ jobs:
- name: Install dependencies
run: go mod download

- name: Install semantic-release
run: |
npm install -g semantic-release @semantic-release/github @semantic-release/git @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/release-notes-generator
- name: Semantic Release
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release

- name: Build for multiple platforms
if: steps.semantic.outputs.new_release_published == 'true'
env:
VERSION: ${{ steps.semantic.outputs.new_release_version }}
run: |
GOOS=linux GOARCH=amd64 go build -o build/phpup-linux-amd64
GOOS=linux GOARCH=arm64 go build -o build/phpup-linux-arm64
GOOS=darwin GOARCH=amd64 go build -o build/phpup-darwin-amd64
GOOS=darwin GOARCH=arm64 go build -o build/phpup-darwin-arm64
GOOS=windows GOARCH=amd64 go build -o build/phpup-windows-amd64.exe
- name: Release
uses: softprops/action-gh-release@v2
if: steps.semantic.outputs.new_release_published == 'true'
with:
files: |
build/phpup-linux-amd64
build/phpup-linux-arm64
build/phpup-darwin-amd64
build/phpup-darwin-arm64
build/phpup-windows-amd64.exe
- name: Install semantic-release
run: |
npm install -g semantic-release @semantic-release/github @semantic-release/git @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/release-notes-generator
- name: Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ phpup

# Go workspace file
go.work

# Build artifacts
build/
phpup-*
34 changes: 28 additions & 6 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
{
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/github",
[
"@semantic-release/github",
{
"assets": [
{
"path": "build/phpup-linux-amd64",
"label": "Linux AMD64"
},
{
"path": "build/phpup-linux-arm64",
"label": "Linux ARM64"
},
{
"path": "build/phpup-darwin-amd64",
"label": "macOS AMD64"
},
{
"path": "build/phpup-darwin-arm64",
"label": "macOS ARM64"
},
{
"path": "build/phpup-windows-amd64.exe",
"label": "Windows AMD64"
}
]
}
],
"@semantic-release/git"
],
"initialVersion": "0.0.1"
]
}

0 comments on commit 9649378

Please sign in to comment.