diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index b3e391f..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: Release - -on: - push: - tags: - - "v*" - -permissions: - contents: write - -jobs: - goreleaser: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: stable - - - name: Set up Git for Gitea - run: | - git config --global url."https://\token:${{ secrets.API_TOKEN }}@git.mvl.sh/".insteadOf "https://git.mvl.sh/" - - - name: Build binaries - id: build - run: | - # Get version from tag - VERSION=${GITHUB_REF#refs/tags/} - echo "Building version ${VERSION}..." - - # Set up directories - mkdir -p dist/linux_amd64 - mkdir -p dist/linux_arm64 - mkdir -p dist/darwin_amd64 - mkdir -p dist/darwin_arm64 - - # Build for different platforms - LDFLAGS="-s -w -X git.mvl.sh/vleeuwenmenno/sshtunnel/cmd.Version=${VERSION} -X git.mvl.sh/vleeuwenmenno/sshtunnel/cmd.BuildDate=$(date -u '+%Y-%m-%d %H:%M:%S')" - - # Linux amd64 - GOOS=linux GOARCH=amd64 go build -ldflags="$LDFLAGS" -o dist/linux_amd64/sshtunnel - tar -czf dist/sshtunnel_Linux_x86_64.tar.gz -C dist/linux_amd64 sshtunnel - - # Linux arm64 - GOOS=linux GOARCH=arm64 go build -ldflags="$LDFLAGS" -o dist/linux_arm64/sshtunnel - tar -czf dist/sshtunnel_Linux_arm64.tar.gz -C dist/linux_arm64 sshtunnel - - # macOS amd64 - GOOS=darwin GOARCH=amd64 go build -ldflags="$LDFLAGS" -o dist/darwin_amd64/sshtunnel - tar -czf dist/sshtunnel_Darwin_x86_64.tar.gz -C dist/darwin_amd64 sshtunnel - - # macOS arm64 - GOOS=darwin GOARCH=arm64 go build -ldflags="$LDFLAGS" -o dist/darwin_arm64/sshtunnel - tar -czf dist/sshtunnel_Darwin_arm64.tar.gz -C dist/darwin_arm64 sshtunnel - - # Generate checksums - cd dist && sha256sum *.tar.gz > checksums.txt - - - name: Generate completion scripts - run: | - mkdir -p dist/completions - # Generate completion scripts for different shells - dist/linux_amd64/sshtunnel completion bash > dist/completions/sshtunnel.bash - dist/linux_amd64/sshtunnel completion zsh > dist/completions/sshtunnel.zsh - dist/linux_amd64/sshtunnel completion fish > dist/completions/sshtunnel.fish - - - name: Create Gitea Release - env: - GITEA_TOKEN: ${{ secrets.API_TOKEN }} - run: | - # Get version from tag - VERSION=${GITHUB_REF#refs/tags/} - - # Create release on Gitea - curl -X POST \ - -H "Content-Type: application/json" \ - -H "Authorization: token $GITEA_TOKEN" \ - -d "{\"tag_name\": \"$VERSION\", \"name\": \"$VERSION\", \"body\": \"Release $VERSION\"}" \ - "https://git.mvl.sh/api/v1/repos/vleeuwenmenno/sshtunnel/releases" - - # Upload release assets - for file in dist/*.tar.gz dist/checksums.txt; do - echo "Uploading $file..." - curl -X POST \ - -H "Authorization: token $GITEA_TOKEN" \ - -F "attachment=@$file" \ - "https://git.mvl.sh/api/v1/repos/vleeuwenmenno/sshtunnel/releases/$VERSION/assets" - done - - - name: Update latest tag - run: | - git tag -f latest - git push -f origin latest diff --git a/.goreleaser.yml b/.goreleaser.yml deleted file mode 100644 index 0382f9d..0000000 --- a/.goreleaser.yml +++ /dev/null @@ -1,100 +0,0 @@ -# This is a GoReleaser configuration file for sshtunnel -# Compatible with GoReleaser v1.26.2 -# https://goreleaser.com/customization/ - -before: - hooks: - - go mod tidy - -builds: - - env: - - CGO_ENABLED=0 - goos: - - linux - - darwin - goarch: - - amd64 - - arm64 - flags: - - -trimpath - ldflags: - - -s -w - - -X git.mvl.sh/vleeuwenmenno/sshtunnel/cmd.Version={{.Version}} - - -X git.mvl.sh/vleeuwenmenno/sshtunnel/cmd.BuildDate={{.Date}} - -archives: - - format: tar.gz - name_template: >- - {{ .ProjectName }}_ - {{- title .Os }}_ - {{- if eq .Arch "amd64" }}x86_64 - {{- else if eq .Arch "386" }}i386 - {{- else }}{{ .Arch }}{{ end }} - {{- if .Arm }}v{{ .Arm }}{{ end }} - format_overrides: - - goos: windows - format: zip - -checksum: - name_template: "checksums.txt" - -snapshot: - name_template: "{{ incpatch .Version }}-next" - -changelog: - sort: asc - filters: - exclude: - - "^docs:" - - "^test:" - -# Homebrew formula -brews: - - name: sshtunnel - homepage: "https://git.mvl.sh/vleeuwenmenno/sshtunnel" - description: "SSH tunnel manager CLI tool" - license: "MIT" - commit_author: - name: goreleaserbot - email: goreleaser@carlosbecker.com - install: | - bin.install "sshtunnel" - - # Generate shell completions - output = Utils.safe_popen_read("#{bin}/sshtunnel", "completion", "bash") - (bash_completion/"sshtunnel").write output - - output = Utils.safe_popen_read("#{bin}/sshtunnel", "completion", "zsh") - (zsh_completion/"_sshtunnel").write output - - output = Utils.safe_popen_read("#{bin}/sshtunnel", "completion", "fish") - (fish_completion/"sshtunnel.fish").write output - test: | - system "#{bin}/sshtunnel", "version" - -# .deb and .rpm packages -nfpms: - - file_name_template: "{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" - homepage: https://git.mvl.sh/vleeuwenmenno/sshtunnel - description: "SSH tunnel manager CLI tool" - maintainer: Menno van Leeuwen - license: MIT - vendor: vleeuwenmenno - formats: - - deb - - rpm - dependencies: - - openssh-client - recommends: - - bash-completion - scripts: - postinstall: | - mkdir -p /usr/share/bash-completion/completions/ - mkdir -p /usr/share/zsh/site-functions/ - mkdir -p /usr/share/fish/vendor_completions.d/ - sshtunnel completion bash > /usr/share/bash-completion/completions/sshtunnel - sshtunnel completion zsh > /usr/share/zsh/site-functions/_sshtunnel - sshtunnel completion fish > /usr/share/fish/vendor_completions.d/sshtunnel.fish - chmod 644 /usr/share/bash-completion/completions/sshtunnel || true - chmod 644 /usr/share/zsh/site-functions/_sshtunnel || true - chmod 644 /usr/share/fish/vendor_completions.d/sshtunnel.fish || true