Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions .github/workflows/build.yml

This file was deleted.

89 changes: 89 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
on: [push, pull_request]
name: goreleaser
jobs:
test:
strategy:
matrix:
go-version: [1.16.x, 1.17.x]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Checkout code
uses: actions/checkout@v2
- name: Install Python dependencies
run: |
python -m pip install --upgrade iso8601 requests securesystemslib six tuf
- name: Format Unix
if: runner.os == 'Linux'
run: test -z $(go fmt ./...)
- name: Test
run: go test -race -covermode atomic -coverprofile='profile.cov' ./...
- name: Send coverage
if: runner.os == 'Linux'
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
GO111MODULE=off go get github.com/mattn/goveralls
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github
- name: Vet
run: go vet ./...
- name: Install staticcheck
run: "go install honnef.co/go/tools/cmd/staticcheck@v0.2.2"
- name: Run staticcheck
run: staticcheck ./...
release-all:
permissions:
id-token: write
contents: write
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: might be simpler to have this in a separate workflow with on: push: tags?

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: 'v1.2.5'
args: release --config ./.goreleaser/all.yml --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-client:
permissions:
id-token: write
contents: write
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: 'v1.2.5'
args: release --config ./.goreleaser/client.yml --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 19 additions & 0 deletions .goreleaser/all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
project_name: tuf
builds:
- ldflags:
- "-s -w"
- "-extldflags=-zrelro"
- "-extldflags=-znow"
env:
- "CGO_ENABLED=0"
- "GO111MODULE=on"
- "GOFLAGS=-mod=readonly -trimpath"
goos:
- linux
- darwin
- windows
goarch:
- amd64
main: ./cmd/tuf/
source:
enabled: true
17 changes: 17 additions & 0 deletions .goreleaser/client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
project_name: tuf-client
builds:
- ldflags:
- "-s -w"
- "-extldflags=-zrelro"
- "-extldflags=-znow"
env:
- "CGO_ENABLED=0"
- "GO111MODULE=on"
- "GOFLAGS=-mod=readonly -trimpath"
goos:
- linux
- darwin
- windows
goarch:
- amd64
main: ./cmd/tuf-client/