diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index be35508..5f8bbd3 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -4,8 +4,6 @@ on: push: branches: [main] tags: ["v*"] - pull_request: - branches: [main] env: REGISTRY: ghcr.io diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..59cc6ca --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,99 @@ +name: Create Tag and Release + +on: + workflow_dispatch: + inputs: + tag: + description: "Release tag (required, e.g. v0.2.0)" + required: true + type: string + prerelease: + description: "Mark as pre-release" + required: false + type: boolean + default: false + draft: + description: "Create as draft" + required: false + type: boolean + default: false + +jobs: + create-tag: + name: Create Git Tag + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Create and push tag + shell: bash + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git tag -a "${{ inputs.tag }}" -m "Release ${{ inputs.tag }}" + git push origin "${{ inputs.tag }}" + + build-binaries: + name: Build Release Binaries + needs: create-tag + runs-on: ubuntu-latest + steps: + - name: Checkout tag + uses: actions/checkout@v4 + with: + ref: ${{ inputs.tag }} + + - name: Setup Go from go.mod + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Build all binaries + run: make build-all + + - name: Generate checksums + shell: bash + run: | + shasum -a 256 build/picoclaw-* > build/sha256sums.txt + + - name: Upload release binaries artifact + uses: actions/upload-artifact@v4 + with: + name: picoclaw-binaries + path: | + build/picoclaw-* + build/sha256sums.txt + if-no-files-found: error + + create-release: + name: Create GitHub Release + needs: [create-tag, build-binaries] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: release-artifacts + + - name: Show downloaded files + run: ls -R release-artifacts + + - name: Create release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ inputs.tag }} + name: ${{ inputs.tag }} + draft: ${{ inputs.draft }} + prerelease: ${{ inputs.prerelease }} + files: | + release-artifacts/**/* + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/assets/wechat.png b/assets/wechat.png index 4e9d0df..73b09da 100644 Binary files a/assets/wechat.png and b/assets/wechat.png differ diff --git a/cmd/picoclaw/main.go b/cmd/picoclaw/main.go index 31d8dad..19867b0 100644 --- a/cmd/picoclaw/main.go +++ b/cmd/picoclaw/main.go @@ -35,7 +35,7 @@ import ( ) var ( - version = "0.1.0" + version = "dev" buildTime string goVersion string ) @@ -43,7 +43,7 @@ var ( const logo = "🦞" func printVersion() { - fmt.Printf("%s picoclaw v%s\n", logo, version) + fmt.Printf("%s picoclaw %s\n", logo, version) if buildTime != "" { fmt.Printf(" Build: %s\n", buildTime) }