From eb6f1c3c4d4e1e937484ebc829a65750f5eb8dd2 Mon Sep 17 00:00:00 2001 From: Kazuki Sawada Date: Tue, 19 Jul 2022 04:11:43 +0900 Subject: [PATCH] add release config --- .github/workflows/publish-release.yml | 20 ++++++++++ .../{build.yml => push-docker-image.yml} | 8 ++-- .gitignore | 5 ++- .goreleaser.yaml | 39 +++++++++++++++++++ 4 files changed, 66 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/publish-release.yml rename .github/workflows/{build.yml => push-docker-image.yml} (79%) create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml new file mode 100644 index 0000000..5b25f73 --- /dev/null +++ b/.github/workflows/publish-release.yml @@ -0,0 +1,20 @@ +name: Publish release + +on: + push: + tags: + - "*" + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version-file: go.mod + - uses: goreleaser/goreleaser-action@v3 + with: + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build.yml b/.github/workflows/push-docker-image.yml similarity index 79% rename from .github/workflows/build.yml rename to .github/workflows/push-docker-image.yml index fc43af2..120f497 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/push-docker-image.yml @@ -1,4 +1,4 @@ -name: build and push docker image +name: Push docker image on: push: @@ -6,14 +6,14 @@ on: - master jobs: - build_and_push: + push: runs-on: ubuntu-latest permissions: packages: write contents: read steps: - - uses: actions/checkout@v2 - - uses: docker/login-action@v1 + - uses: actions/checkout@v3 + - uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.actor }} diff --git a/.gitignore b/.gitignore index 11e3c35..3e58562 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /pprotein +/pprotein-mock /pprotein-agent - -/data +/data/ +/dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..2a1cb87 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,39 @@ +before: + hooks: + - go mod tidy + - npm --prefix view ci + - npm --prefix view run build +builds: + - id: pprotein + binary: pprotein + main: ./cli/pprotein + flags: + - -trimpath + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + goarch: + - amd64 + - arm64 + - id: pprotein-agent + binary: pprotein-agent + main: ./cli/pprotein-agent + flags: + - -trimpath + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + goarch: + - amd64 + - arm64 +archives: + - files: + - nothing* +checksum: + disable: true +changelog: + skip: true