-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Dominik Schulz <[email protected]>
- Loading branch information
1 parent
6ed7576
commit a2aff2a
Showing
4 changed files
with
101 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: release gopass-hibp | ||
|
||
# Controls when the action will run. | ||
on: | ||
# Triggers the workflow on tags starting with v, i.e. release tags | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
- | ||
name: Import GPG signing key | ||
id: import_gpg | ||
uses: crazy-max/ghaction-import-gpg@v5 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.PASSPHRASE }} | ||
- | ||
name: Debug | ||
run: | | ||
echo "GPG ---------------------" | ||
echo "fingerprint: ${{ steps.import_gpg.outputs.fingerprint }}" | ||
echo "keyid: ${{ steps.import_gpg.outputs.keyid }}" | ||
echo "name: ${{ steps.import_gpg.outputs.name }}" | ||
echo "email: ${{ steps.import_gpg.outputs.email }}" | ||
echo "Go env ------------------" | ||
pwd | ||
echo ${HOME} | ||
echo ${GITHUB_WORKSPACE} | ||
echo ${GOPATH} | ||
echo ${GOROOT} | ||
env | ||
- | ||
name: Generate release-notes | ||
run: | | ||
go run helpers/changelog/main.go >../RELEASE_NOTES | ||
- | ||
name: Run GoReleaser | ||
uses: goreleaser/[email protected] | ||
with: | ||
version: latest | ||
args: release --rm-dist --release-notes=../RELEASE_NOTES | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | ||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | ||
GOPATH: /home/runner/go | ||
- | ||
name: "Upload deb files to apt hosting" | ||
run: | | ||
for D in dist/*.deb; do | ||
curl -H"X-Filename: ${D}" -H"X-Apikey: ${APIKEY}" -XPOST --data-binary @$D https://packages.gopass.pw/repos/gopass/upload | ||
done | ||
env: | ||
APIKEY: ${{ secrets.APT_APIKEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Build gopass | ||
name: Build gopass-hibp | ||
|
||
on: | ||
push: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package main | ||
|
||
import ( | ||
"bufio" | ||
"fmt" | ||
"os" | ||
"strings" | ||
) | ||
|
||
func main() { | ||
fh, err := os.Open("CHANGELOG.md") | ||
if err != nil { | ||
panic(err) | ||
} | ||
defer fh.Close() | ||
|
||
s := bufio.NewScanner(fh) | ||
var in bool | ||
for s.Scan() { | ||
line := s.Text() | ||
if strings.HasPrefix(line, "## ") { | ||
if in { | ||
break | ||
} | ||
in = true | ||
} | ||
|
||
fmt.Println(line) | ||
} | ||
} |