Merge pull request #130 from benbjohnson/static
Add static release builds
This commit is contained in:
52
.github/workflows/release.linux_amd64.yml
vendored
Normal file
52
.github/workflows/release.linux_amd64.yml
vendored
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
on:
|
||||||
|
release:
|
||||||
|
types:
|
||||||
|
- created
|
||||||
|
|
||||||
|
name: release (linux/amd64-static)
|
||||||
|
jobs:
|
||||||
|
linux:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-go@v2
|
||||||
|
|
||||||
|
- id: release
|
||||||
|
uses: bruceadams/get-release@v1.2.2
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Install nfpm
|
||||||
|
run: |
|
||||||
|
wget https://github.com/goreleaser/nfpm/releases/download/v2.2.3/nfpm_2.2.3_Linux_x86_64.tar.gz
|
||||||
|
tar zxvf nfpm_2.2.3_Linux_x86_64.tar.gz
|
||||||
|
|
||||||
|
- name: Build litestream
|
||||||
|
run: |
|
||||||
|
mkdir -p dist
|
||||||
|
cp etc/litestream.yml etc/litestream.service dist
|
||||||
|
cat etc/nfpm.yml | LITESTREAM_VERSION=${{ steps.release.outputs.tag_name }} envsubst > dist/nfpm.yml
|
||||||
|
go build -ldflags "-w -extldflags "-static" -X 'main.Version=${{ steps.release.outputs.tag_name }}'" -o dist/litestream ./cmd/litestream
|
||||||
|
cd dist
|
||||||
|
tar -czvf litestream-${{ steps.release.outputs.tag_name }}-linux-amd64-static.tar.gz litestream
|
||||||
|
../nfpm pkg --config nfpm.yml --packager deb --target litestream-${{ steps.release.outputs.tag_name }}-linux-amd64-static.deb
|
||||||
|
|
||||||
|
- name: Upload release binary
|
||||||
|
uses: actions/upload-release-asset@v1.0.2
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.release.outputs.upload_url }}
|
||||||
|
asset_path: ./dist/litestream-${{ steps.release.outputs.tag_name }}-linux-amd64-static.tar.gz
|
||||||
|
asset_name: litestream-${{ steps.release.outputs.tag_name }}-linux-amd64-static.tar.gz
|
||||||
|
asset_content_type: application/gzip
|
||||||
|
|
||||||
|
- name: Upload debian package
|
||||||
|
uses: actions/upload-release-asset@v1.0.2
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.release.outputs.upload_url }}
|
||||||
|
asset_path: ./dist/litestream-${{ steps.release.outputs.tag_name }}-linux-amd64-static.deb
|
||||||
|
asset_name: litestream-${{ steps.release.outputs.tag_name }}-linux-amd64-static.deb
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
@@ -3,7 +3,7 @@ on:
|
|||||||
types:
|
types:
|
||||||
- created
|
- created
|
||||||
|
|
||||||
name: release
|
name: release (linux/amd64)
|
||||||
jobs:
|
jobs:
|
||||||
linux:
|
linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
Reference in New Issue
Block a user