Skip to content

Commit 4791fb4

Browse files
workflows: Create separate workflows for build and release
build: Build and upload artifacts on each commit, pull request and tag. release: Build and trigger a release only for v*.*.0 style tags. Signed-off-by: Sai Sree Kartheek Adivi <sskartheekadivi@gmail.com>
1 parent 8f5a353 commit 4791fb4

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed

.github/workflows/build.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
steps:
17+
- name: Checkout repo
18+
uses: actions/checkout@v4
19+
20+
- name: Install dependencies
21+
run: |
22+
cargo install cargo-deb
23+
24+
- name: Build binary
25+
run: |
26+
cargo build
27+
28+
- name: Build deb package
29+
run: |
30+
cargo deb
31+
32+
- name: Upload deb package to artifacts
33+
uses: actions/upload-artifact@v4
34+
with:
35+
path: target/debian/*.deb

.github/workflows/cargo.yml renamed to .github/workflows/release.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
name: Build and Publish Debian Package
1+
name: Release
22

33
on:
44
push:
5-
branches:
6-
- master
75
tags:
8-
- 'v*'
9-
pull_request:
6+
- 'v*.*.0'
107

118
jobs:
129
build:
@@ -33,6 +30,5 @@ jobs:
3330

3431
- name: Release
3532
uses: softprops/action-gh-release@v2
36-
if: github.ref_type == 'tag'
3733
with:
3834
files: target/debian/*.deb

0 commit comments

Comments
 (0)