Support ARM release builds
This commit is contained in:
@@ -3,10 +3,25 @@ on:
|
||||
types:
|
||||
- created
|
||||
|
||||
name: release (linux/amd64)
|
||||
name: release (linux)
|
||||
jobs:
|
||||
linux:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- arch: amd64
|
||||
cc: gcc
|
||||
- arch: arm64
|
||||
cc: aarch64-linux-gnu-gcc
|
||||
- arch: arm
|
||||
cc: arm-linux-gnueabihf-gcc
|
||||
|
||||
env:
|
||||
GOOS: linux
|
||||
GOARCH: ${{ matrix.arch }}
|
||||
CC: ${{ matrix.cc }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-go@v2
|
||||
@@ -16,6 +31,11 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
|
||||
- name: Install cross-compilers
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf
|
||||
|
||||
- name: Install nfpm
|
||||
run: |
|
||||
wget https://github.com/goreleaser/nfpm/releases/download/v2.2.3/nfpm_2.2.3_Linux_x86_64.tar.gz
|
||||
@@ -23,14 +43,15 @@ jobs:
|
||||
|
||||
- name: Build litestream
|
||||
run: |
|
||||
rm -rf dist
|
||||
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
|
||||
tar -czvf litestream-${{ steps.release.outputs.tag_name }}-${{ env.GOOS }}-${{ env.GOARCH }}.tar.gz litestream
|
||||
../nfpm pkg --config nfpm.yml --packager deb --target litestream-${{ steps.release.outputs.tag_name }}-${{ env.GOOS }}-${{ env.GOARCH }}.deb
|
||||
|
||||
- name: Upload release binary
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
@@ -39,7 +60,7 @@ jobs:
|
||||
with:
|
||||
upload_url: ${{ steps.release.outputs.upload_url }}
|
||||
asset_path: ./dist/litestream
|
||||
asset_name: litestream-${{ steps.release.outputs.tag_name }}-linux-amd64
|
||||
asset_name: litestream-${{ steps.release.outputs.tag_name }}-${{ env.GOOS }}-${{ env.GOARCH }}
|
||||
asset_content_type: application/octet-stream
|
||||
|
||||
- name: Upload release tarball
|
||||
@@ -48,8 +69,8 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
with:
|
||||
upload_url: ${{ steps.release.outputs.upload_url }}
|
||||
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_path: ./dist/litestream-${{ steps.release.outputs.tag_name }}-${{ env.GOOS }}-${{ env.GOARCH }}.tar.gz
|
||||
asset_name: litestream-${{ steps.release.outputs.tag_name }}-${{ env.GOOS }}-${{ env.GOARCH }}.tar.gz
|
||||
asset_content_type: application/gzip
|
||||
|
||||
- name: Upload debian package
|
||||
@@ -58,6 +79,6 @@ jobs:
|
||||
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_path: ./dist/litestream-${{ steps.release.outputs.tag_name }}-${{ env.GOOS }}-${{ env.GOARCH }}.deb
|
||||
asset_name: litestream-${{ steps.release.outputs.tag_name }}-${{ env.GOOS }}-${{ env.GOARCH }}.deb
|
||||
asset_content_type: application/octet-stream
|
||||
@@ -3,10 +3,25 @@ on:
|
||||
types:
|
||||
- created
|
||||
|
||||
name: release (linux/amd64-static)
|
||||
name: release (linux/static)
|
||||
jobs:
|
||||
linux:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- arch: amd64
|
||||
cc: gcc
|
||||
- arch: arm64
|
||||
cc: aarch64-linux-gnu-gcc
|
||||
- arch: arm
|
||||
cc: arm-linux-gnueabihf-gcc
|
||||
|
||||
env:
|
||||
GOOS: linux
|
||||
GOARCH: ${{ matrix.arch }}
|
||||
CC: ${{ matrix.cc }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-go@v2
|
||||
@@ -16,20 +31,18 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
|
||||
- name: Install nfpm
|
||||
- name: Install cross-compilers
|
||||
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
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf
|
||||
|
||||
- name: Build litestream
|
||||
run: |
|
||||
rm -rf dist
|
||||
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
|
||||
tar -czvf litestream-${{ steps.release.outputs.tag_name }}-${{ env.GOOS }}-${{ env.GOARCH }}-static.tar.gz litestream
|
||||
|
||||
- name: Upload release binary
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
@@ -38,7 +51,7 @@ jobs:
|
||||
with:
|
||||
upload_url: ${{ steps.release.outputs.upload_url }}
|
||||
asset_path: ./dist/litestream
|
||||
asset_name: litestream-${{ steps.release.outputs.tag_name }}-linux-amd64-static
|
||||
asset_name: litestream-${{ steps.release.outputs.tag_name }}-${{ env.GOOS }}-${{ env.GOARCH }}-static
|
||||
asset_content_type: application/octet-stream
|
||||
|
||||
- name: Upload release tarball
|
||||
@@ -47,16 +60,6 @@ jobs:
|
||||
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_path: ./dist/litestream-${{ steps.release.outputs.tag_name }}-${{ env.GOOS }}-${{ env.GOARCH }}-static.tar.gz
|
||||
asset_name: litestream-${{ steps.release.outputs.tag_name }}-${{ env.GOOS }}-${{ env.GOARCH }}-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
|
||||
Reference in New Issue
Block a user