Update Go Build.yml #24
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: Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| Build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - | |
| name: Private Actions Checkout | |
| uses: actions/checkout@v5 | |
| - | |
| name: Get Data | |
| id: time | |
| run: echo "dir=$(date +'%Y-%m-%d/%H:%M:%S')" >> $GITHUB_OUTPUT | |
| - | |
| name: Get commitId | |
| id: commitId | |
| run: echo "dir=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
| - | |
| name: Get latest version | |
| id: current-version | |
| uses: cardinalby/git-get-release-action@v1.1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }} | |
| with: | |
| latest: true | |
| prerelease: false | |
| - | |
| name: Generate next version | |
| uses: HardNorth/github-version-generate@v1.4 | |
| with: | |
| version: ${{ steps.current-version.outputs.tag_name }} | |
| next-version-increment-patch: true | |
| - | |
| name: Build with xgo | |
| uses: crazy-max/ghaction-xgo@v3.2.0 | |
| with: | |
| xgo_version: latest | |
| go_version: ${{ matrix.go_version }} | |
| dest: bin | |
| prefix: bitiful | |
| targets: android/386, android/amd64, android/arm, android/arm64, darwin/amd64, darwin/arm64, freebsd/386, freebsd/amd64, freebsd/arm, freebsd/arm64, linux/386, linux/amd64, linux/arm, linux/arm64, linux/mips, linux/mips64, linux/mips64le, linux/mipsle, linux/ppc64, linux/ppc64le, linux/riscv64, linux/s390x, netbsd/386, netbsd/amd64, netbsd/arm, netbsd/arm64, openbsd/386, openbsd/amd64, openbsd/arm, openbsd/arm64, openbsd/mips64, windows/386, windows/amd64, windows/arm, windows/arm64 | |
| v: false | |
| x: true | |
| race: false | |
| ldflags: -s -w -X main.buildTime=${{ steps.time.outputs.dir }} -X main.versionData=${{ github.event.inputs.RELEASE_NAME }} -X main.commitId=${{ steps.commitId.outputs.dir }} -X main.author=XRSec | |
| buildmode: default | |
| - | |
| name: Delete old Releases | |
| uses: dev-drprasad/delete-older-releases@v0.3.4 | |
| with: | |
| repo: ${{ github.repository }} | |
| keep_latest: 3 | |
| delete_tag_pattern: "" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }} | |
| - | |
| name: Make release | |
| uses: softprops/action-gh-release@v2.3.2 | |
| with: | |
| files: "bin/**" | |
| body_path: docs/README.md | |
| name: ${{ env.NEXT_VERSION }} | |
| tag_name: ${{ env.NEXT_VERSION }} | |
| draft: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }} | |
| - | |
| name: Send notification to Feishu | |
| uses: XRSec/feishu-bot-webhook-action@v1 | |
| with: | |
| FEISHU_BOT_WEBHOOK: ${{ secrets.FEISHU_BOT_WEBHOOK }} | |
| FEISHU_BOT_SIGNKEY: ${{ secrets.FEISHU_BOT_SIGNKEY }} |