Skip to content

Commit

Permalink
feat(ci): setup release please
Browse files Browse the repository at this point in the history
Release-As: 0.1.0
  • Loading branch information
sentriz committed Sep 17, 2021
1 parent d6389f9 commit 6bd3aeb
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release
on:
push:
branches:
- master
jobs:
test:
name: Lint and test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17.x
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.42.1
skip-go-installation: true
- name: Test
run: go test ./...
release-please:
name: Run Release Please
runs-on: ubuntu-latest
needs: [test]
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Release Please
uses: google-github-actions/release-please-action@v2
id: release
with:
token: ${{ secrets.CR_PAT }}
release-type: simple
changelog-path: CHANGELOG.md
package-name: cliphist
24 changes: 24 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint and test
on:
push:
branches:
- develop
pull_request:
jobs:
test:
name: Lint and test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17.x
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.42.1
skip-go-installation: true
- name: Test
run: go test ./...
34 changes: 34 additions & 0 deletions .github/workflows/upload-binaries.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Upload binaries
on:
push:
tags:
- "*"
jobs:
build-and-upload:
name: Build and upload
runs-on: ubuntu-latest
strategy:
matrix:
include:
- os: linux
arch: amd64
- os: linux
arch: arm
- os: linux
arch: 386
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17.x
- name: Build binary
run: |
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"' -o cliphist-${{ github.ref }}-${{ matrix.os }}-${{ matrix.arch }} .
- name: Upload
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.CR_PAT }}
file: cliphist-${{ github.ref }}-${{ matrix.os }}-${{ matrix.arch }}
tag: ${{ github.ref }}

0 comments on commit 6bd3aeb

Please sign in to comment.