Skip to content

Commit

Permalink
wip: snapcraft
Browse files Browse the repository at this point in the history
  • Loading branch information
ermos committed Mar 3, 2023
1 parent 6b7436a commit 65fc78e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ name: goreleaser

on:
push:
# run only against tags
branches:
- "!*"
tags:
- '*'
- "v*.*.*"

permissions:
contents: write
Expand All @@ -23,6 +24,10 @@ jobs:
with:
go-version: '>=1.20.1'
cache: true
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v1
with:
snapcraft_token: ${{ secrets.snapcraft_token }}
# More assembly might be required: Docker logins, GPG, etc. It all depends
# on your needs.
- uses: goreleaser/goreleaser-action@v4
Expand Down
18 changes: 1 addition & 17 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,4 @@ checksum:
name_template: 'checksums.txt'

snapshot:
name_template: "{{ .Tag }}"

snapcrafts:
-
name: polyrule
summary: Software to compile validator rules into multiple languages.
description: Software to compile validator rules into multiple languages.
publish: false
grade: stable
# https://snapcraft.io/docs/reference/confinement
confinement: strict
license: MIT
base: core22
apps:
polyrule:
command: bin/polyrule
plugs: [ "system-files"]
name_template: "{{ .Tag }}"
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
build/bin:
@go build -o ${GOPATH}/bin/polyrule ./
@go build -o ${GOPATH}/bin/polyrule ./

build: test
goreleaser --snapshot --skip-publish --rm-dist

release:
test $(VERSION)
git tag -a v$(VERSION) -m "$(VERSION)"
goreleaser --snapshot --skip-publish --rm-dist

delete-tag:
test $(VERSION)
git tag --delete v$(VERSION)

0 comments on commit 65fc78e

Please sign in to comment.