Skip to content

Commit

Permalink
Publish Debian package with Git Tag to Github Release (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj authored Jun 7, 2023
1 parent ff03776 commit b508d89
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build and test
name: Nexus build and test

on:
push:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Publish debian package
name: Dev Debian package

on:
push:
branches: [main, release/*]
branches: [main]
pull_request:
branches: [main]

Expand Down Expand Up @@ -45,10 +45,3 @@ jobs:
- name: create peerdb-server deb package
working-directory: ./nexus/
run: cargo deb --target=x86_64-unknown-linux-musl -p peerdb-server --no-build

# - name: upload release artifacts
# uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
# with:
# files: |
# nexus/server/target/x86_64-unknown-linux-musl/debian/peerdb-server*.deb
2 changes: 1 addition & 1 deletion .github/workflows/flow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build and test
name: Flow build and test

on:
push:
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/stable-debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Stable Debian package

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
release:
name: build and release
runs-on: ubuntu-latest-16-cores
permissions:
contents: write
steps:
- name: checkout sources
uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.SUBMODULE_CHECKOUT }}

- name: install system tools
run: |
sudo apt-get update
sudo apt-get install -y musl-tools protobuf-compiler gcc-multilib \
protobuf-compiler libssl-dev pkg-config build-essential
- name: install cargo binstall
run: |
curl -L --proto '=https' --tlsv1.2 -sSf\
https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
- name: install cargo binaries
run: |
cargo binstall --no-confirm --no-symlinks cargo-deb cargo-zigbuild
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-musl

- uses: goto-bus-stop/setup-zig@v2

- name: Set Cargo version as Git tag
working-directory: ./nexus/server
run: |
export VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
sed -i "s/0.1.0/$VERSION/g" Cargo.toml
- name: build project release
working-directory: ./nexus
run: cargo zigbuild --release --target=x86_64-unknown-linux-musl

- name: create peerdb-server deb package
working-directory: ./nexus/
run: cargo deb --target=x86_64-unknown-linux-musl -p peerdb-server --no-build

- name: upload release artifacts
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
nexus/target/x86_64-unknown-linux-musl/debian/peerdb-server*.deb
4 changes: 2 additions & 2 deletions .github/workflows/stable-docker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish docker images
name: Stable Docker images

on:
push:
Expand Down Expand Up @@ -38,4 +38,4 @@ jobs:
file: stacks/nexus.Dockerfile
push: true
tags: |
'ghcr.io/peerdb-io/peerdb-server:${{ github.ref }}'
ghcr.io/peerdb-io/peerdb-server:${{ github.ref_name }}

0 comments on commit b508d89

Please sign in to comment.