Skip to content

Commit

Permalink
Updated release action
Browse files Browse the repository at this point in the history
  • Loading branch information
russss committed Mar 13, 2024
1 parent aaef93a commit b34806f
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 17 deletions.
32 changes: 15 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ jobs:
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand All @@ -28,30 +30,26 @@ jobs:
tags: |
type=semver,pattern={{version}}
type=sha
- uses: actions/setup-go@v2
- uses: actions/setup-go@v5
with:
go-version: "^1.17.3"
go-version: stable
- name: Check Formatting
run: gofmt -d -e .
- name: Tests
run: go test -v ./...
- name: Build
run: |
go get github.com/mitchellh/gox
gox -ldflags="-X main.branch=${{github.ref_name}} -X main.revision=${{github.sha}}" -osarch="linux/amd64 linux/arm darwin/amd64" -output="dist/{{.OS}}_{{.Arch}}_{{.Dir}}"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Dockerfile
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
dist/linux_amd64_irccat
dist/linux_arm_irccat
dist/darwin_amd64_irccat
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
irccat
irccat.json

dist/
24 changes: 24 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 1

before:
hooks:
- go mod tidy

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
ldflags:
- -X main.branch={{.Version}} -X main.revision={{.Commit}}

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

0 comments on commit b34806f

Please sign in to comment.