diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2de0a26 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,89 @@ +# yaml-language-server: https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json +--- +name: goreleaser + +on: + create: + tags: + - "**" + +permissions: + contents: write + packages: write + # issues: write + +jobs: + test-mac: + runs-on: macos-latest + steps: + - name: Setup Go environment + uses: actions/setup-go@v5 + with: + go-version: stable + cache: true + architecture: x64 + - name: Checkout + uses: actions/checkout@v4 + - name: Build + run: go build ./... + - name: Test + run: go test ./... -v + test-win: + runs-on: windows-latest + steps: + - name: Setup Go environment + uses: actions/setup-go@v5 + with: + go-version: stable + cache: true + architecture: x64 + - name: Checkout + uses: actions/checkout@v4 + - name: Build + run: go build ./... + - name: Test + run: go test ./... -v + test-linux: + runs-on: ubuntu-latest + steps: + - name: Setup Go environment + uses: actions/setup-go@v5 + with: + go-version: stable + cache: true + architecture: x64 + - name: Checkout + uses: actions/checkout@v4 + - name: Build + run: go build ./... + - name: Test + run: go test ./... -v + + goreleaser: + needs: + - test-linux + - test-mac + - test-win + 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 + # More assembly might be required: Docker logins, GPG, etc. + # It all depends on your needs. + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + # either 'goreleaser' (default) or 'goreleaser-pro' + distribution: goreleaser + version: ${{ env.GITHUB_REF_NAME }} + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }} + # Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution + # GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..f2b743d --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,35 @@ +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +--- +builds: + - binary: portal + goos: + - darwin + - linux + - windows + goarch: + - amd64 + - arm64 + env: + - CGO_ENABLED=0 + +checksum: + name_template: "checksums.txt" + algorithm: sha256 + +release: + prerelease: auto + +universal_binaries: + - replace: false + mod_timestamp: "{{ .CommitTimestamp }}" + +brews: + - name: portal + homepage: https://github.com/tsukinoko-kun/portal + description: Simple local file sharing + repository: + owner: tsukinoko-kun + name: homebrew-tap + commit_author: + name: tsukinoko-kun + email: gh@frankmayer.dev diff --git a/README.md b/README.md index 7c831f8..d9a3352 100644 --- a/README.md +++ b/README.md @@ -1 +1,15 @@ # portal + +## Install + +### Homebrew + +```shell +brew install tsukinoko-kun/tap/portal +``` + +### Go + +```shell +go install github.com/tsukinoko-kun/portal@latest +```