Skip to content

Commit

Permalink
feat: added install methods homebrew and go
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukinoko-kun committed Sep 3, 2024
1 parent 2714a7d commit 3316003
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 0 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
35 changes: 35 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -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: [email protected]
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
# portal

## Install

### Homebrew

```shell
brew install tsukinoko-kun/tap/portal
```

### Go

```shell
go install github.com/tsukinoko-kun/portal@latest
```

0 comments on commit 3316003

Please sign in to comment.