Debian release action
This commit is contained in:
21
.github/workflows/release.yml
vendored
21
.github/workflows/release.yml
vendored
@@ -5,7 +5,7 @@ on:
|
||||
|
||||
name: release
|
||||
jobs:
|
||||
release:
|
||||
linux:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@@ -18,8 +18,13 @@ jobs:
|
||||
|
||||
- name: Build litestream
|
||||
run: |
|
||||
go build -ldflags "-X 'main.Version=${{ steps.release.outputs.tag_name }}'" -o litestream ./cmd/litestream
|
||||
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 "-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.tar.gz litestream
|
||||
nfpm pkg --config nfpm.yml --packager deb --target litestream-${{ steps.release.outputs.tag_name }}-linux-amd64.deb
|
||||
|
||||
- name: Upload release binary
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
@@ -27,6 +32,16 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
with:
|
||||
upload_url: ${{ steps.release.outputs.upload_url }}
|
||||
asset_path: ./litestream-${{ steps.release.outputs.tag_name }}-linux-amd64.tar.gz
|
||||
asset_path: ./dist/litestream-${{ steps.release.outputs.tag_name }}-linux-amd64.tar.gz
|
||||
asset_name: litestream-${{ steps.release.outputs.tag_name }}-linux-amd64.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.deb
|
||||
asset_name: litestream-${{ steps.release.outputs.tag_name }}-linux-amd64.deb
|
||||
asset_content_type: application/octet-stream
|
||||
|
||||
4
Makefile
4
Makefile
@@ -7,8 +7,8 @@ dist:
|
||||
tar -cz -f dist/litestream-linux-amd64.tar.gz -C dist litestream
|
||||
|
||||
deb: dist
|
||||
ifndef VERSION
|
||||
$(error VERSION is undefined)
|
||||
ifndef LITESTREAM_VERSION
|
||||
$(error LITESTREAM_VERSION is undefined)
|
||||
endif
|
||||
cat etc/nfpm.yml | envsubst > dist/nfpm.yml
|
||||
nfpm pkg --config dist/nfpm.yml --packager deb --target dist/litestream.deb
|
||||
|
||||
@@ -23,7 +23,7 @@ You can download the `.deb` file from the [Releases page][releases] page and
|
||||
then run the following:
|
||||
|
||||
```sh
|
||||
$ sudo dpkg -i litestream-v0.3.0.deb
|
||||
$ sudo dpkg -i litestream-v0.3.0-linux-amd64.deb
|
||||
```
|
||||
|
||||
Once installed, you'll need to enable & start the service:
|
||||
|
||||
@@ -9,11 +9,11 @@ description: Litestream is a tool for real-time replication of SQLite databases.
|
||||
homepage: "https://github.com/benbjohnson/litestream"
|
||||
license: "GPLv3"
|
||||
contents:
|
||||
- src: ./dist/litestream
|
||||
- src: ./litestream
|
||||
dst: /usr/bin/litestream
|
||||
- src: ./etc/litestream.yml
|
||||
- src: ./litestream.yml
|
||||
dst: /etc/litestream.yml
|
||||
type: config
|
||||
- src: ./etc/litestream.service
|
||||
- src: ./litestream.service
|
||||
dst: /usr/lib/systemd/system/litestream.service
|
||||
type: config
|
||||
type: config
|
||||
|
||||
Reference in New Issue
Block a user