Compare commits
2 Commits
81163cc60f
...
38653c6ab5
Author | SHA1 | Date | |
---|---|---|---|
38653c6ab5 | |||
b5cbbeab90 |
@ -1,4 +1,4 @@
|
||||
name: Release
|
||||
name: Create distribution
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -41,21 +41,13 @@ jobs:
|
||||
run: >-
|
||||
go generate ./...
|
||||
|
||||
- name: Build for Linux
|
||||
run: >-
|
||||
go build -v -ldflags '-s -w
|
||||
-X git.ophivana.moe/security/fortify/internal.Version=${{ github.ref_name }}
|
||||
-X git.ophivana.moe/security/fortify/internal.Fsu=/usr/bin/fsu
|
||||
-X git.ophivana.moe/security/fortify/internal.Finit=/usr/libexec/fortify/finit
|
||||
-X main.Fmain=/usr/bin/fortify
|
||||
-X main.Fshim=/usr/libexec/fortify/fshim'
|
||||
-o bin/ ./... &&
|
||||
(cd bin && sha512sum --tag -b * > sha512sums)
|
||||
- name: Build for release
|
||||
run: FORTIFY_VERSION='${{ github.ref_name }}' ./dist/release.sh
|
||||
|
||||
- name: Release
|
||||
id: use-go-action
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
with:
|
||||
files: |-
|
||||
bin/**
|
||||
dist/fortify-**
|
||||
api_key: '${{secrets.RELEASE_TOKEN}}'
|
||||
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -25,4 +25,7 @@ go.work.sum
|
||||
.vscode
|
||||
|
||||
# go generate
|
||||
security-context-v1-protocol.*
|
||||
security-context-v1-protocol.*
|
||||
|
||||
# release
|
||||
/dist/fortify-*
|
1
dist/fsurc.default
vendored
Normal file
1
dist/fsurc.default
vendored
Normal file
@ -0,0 +1 @@
|
||||
1000 0
|
10
dist/install.sh
vendored
Executable file
10
dist/install.sh
vendored
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
cd "$(dirname -- "$0")" || exit 1
|
||||
|
||||
install -vDm0755 "bin/fortify" "${FORTIFY_INSTALL_PREFIX}/usr/bin/fortify"
|
||||
install -vDm0755 "bin/fshim" "${FORTIFY_INSTALL_PREFIX}/usr/libexec/fortify/fshim"
|
||||
install -vDm0755 "bin/finit" "${FORTIFY_INSTALL_PREFIX}/usr/libexec/fortify/finit"
|
||||
install -vDm0755 "bin/fuserdb" "${FORTIFY_INSTALL_PREFIX}/usr/libexec/fortify/fuserdb"
|
||||
|
||||
install -vDm6511 "bin/fsu" "${FORTIFY_INSTALL_PREFIX}/usr/bin/fsu"
|
||||
install -vDm0400 "fsurc.default" "${FORTIFY_INSTALL_PREFIX}/etc/fsurc"
|
19
dist/release.sh
vendored
Executable file
19
dist/release.sh
vendored
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh -e
|
||||
cd "$(dirname -- "$0")/.."
|
||||
VERSION="${FORTIFY_VERSION:-untagged}"
|
||||
pname="fortify-${VERSION}"
|
||||
out="dist/${pname}"
|
||||
|
||||
mkdir -p "${out}"
|
||||
cp "README.md" "dist/fsurc.default" "dist/install.sh" "${out}"
|
||||
|
||||
go build -v -o "${out}/bin/" -ldflags "-s -w
|
||||
-X git.ophivana.moe/security/fortify/internal.Version=${VERSION}
|
||||
-X git.ophivana.moe/security/fortify/internal.Fsu=/usr/bin/fsu
|
||||
-X git.ophivana.moe/security/fortify/internal.Finit=/usr/libexec/fortify/finit
|
||||
-X main.Fmain=/usr/bin/fortify
|
||||
-X main.Fshim=/usr/libexec/fortify/fshim" ./...
|
||||
|
||||
rm -f "./${out}.tar.gz" && tar -C dist -czf "${out}.tar.gz" "${pname}"
|
||||
rm -rf "./${out}"
|
||||
sha512sum "${out}.tar.gz" > "${out}.tar.gz.sha512"
|
Loading…
Reference in New Issue
Block a user