Skip to content

Commit c39ba45

Browse files
committed
CI/CD: Remove RPM build
* handled externally in OBS
1 parent e33fb89 commit c39ba45

File tree

1 file changed

+54
-61
lines changed

1 file changed

+54
-61
lines changed
Lines changed: 54 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build RPM and DEB for latest Release
1+
name: Build DEB for latest Release
22

33
on:
44
release:
@@ -11,74 +11,67 @@ on:
1111

1212
jobs:
1313
build:
14-
name: Build DEB and RPM
14+
name: Build DEB
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- name: Checkout Code
19-
uses: actions/checkout@v4
18+
- name: Checkout Code
19+
uses: actions/checkout@v4
2020

21-
- name: Set up Rust
22-
uses: actions-rust-lang/setup-rust-toolchain@v1
21+
- name: Set up Rust
22+
uses: actions-rust-lang/setup-rust-toolchain@v1
2323

24-
- name: Install Tools
25-
run: |
26-
sudo apt-get update
27-
sudo apt-get install -y rpm build-essential
28-
cargo install cargo-deb
29-
cargo install cargo-rpm
24+
- name: Install Tools
25+
run: |
26+
sudo apt-get update
27+
sudo apt-get install -y build-essential
28+
cargo install cargo-deb
3029
31-
- name: Build .deb package
32-
run: cargo deb
30+
- name: Build .deb package
31+
run: cargo deb
3332

34-
- name: Build .rpm package
35-
run: |
36-
cargo rpm build
37-
mkdir -p target/release
38-
cp target/release/rpmbuild/RPMS/*/*.rpm target/release/
33+
- name: Get latest release tag
34+
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
35+
id: get_tag
36+
uses: actions/github-script@v7
37+
with:
38+
script: |
39+
const { repo, owner } = context.repo;
40+
let tag;
41+
if (github.event_name === 'release') {
42+
tag = github.event.release.tag_name;
43+
} else {
44+
const latest = await github.rest.repos.getLatestRelease({ owner, repo });
45+
tag = latest.data.tag_name;
46+
}
47+
return tag;
48+
result-encoding: string
3949

40-
- name: Get latest release tag
41-
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
42-
id: get_tag
43-
uses: actions/github-script@v7
44-
with:
45-
script: |
46-
const { repo, owner } = context.repo;
47-
let tag;
48-
if (github.event_name === 'release') {
49-
tag = github.event.release.tag_name;
50-
} else {
51-
const latest = await github.rest.repos.getLatestRelease({ owner, repo });
52-
tag = latest.data.tag_name;
53-
}
54-
return tag;
55-
result-encoding: string
50+
# Avoid building on a non-tagged commit
51+
- name: Check tag commit matches current commit
52+
if: github.event_name == 'workflow_dispatch'
53+
id: verify_commit
54+
uses: actions/github-script@v7
55+
with:
56+
script: |
57+
const { repo, owner } = context.repo;
58+
const tag = '${{ steps.get_tag.result }}';
59+
const tagData = await github.rest.git.getRef({ owner, repo, ref: `tags/${tag}` });
60+
const tagSha = tagData.data.object.sha;
5661
57-
# Avoid building on a non-tagged commit
58-
- name: Check tag commit matches current commit
59-
if: github.event_name == 'workflow_dispatch'
60-
id: verify_commit
61-
uses: actions/github-script@v7
62-
with:
63-
script: |
64-
const { repo, owner } = context.repo;
65-
const tag = '${{ steps.get_tag.result }}';
66-
const tagData = await github.rest.git.getRef({ owner, repo, ref: `tags/${tag}` });
67-
const tagSha = tagData.data.object.sha;
62+
const headSha = process.env.GITHUB_SHA;
6863
69-
const headSha = process.env.GITHUB_SHA;
64+
if (tagSha !== headSha) {
65+
core.setFailed(`Error: Tag ${tag} points to ${tagSha}, but current commit is ${headSha}`);
66+
}
7067
71-
if (tagSha !== headSha) {
72-
core.setFailed(`Error: Tag ${tag} points to ${tagSha}, but current commit is ${headSha}`);
73-
}
74-
75-
- name: Upload release assets
76-
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' # only run on release or manual dispatch
77-
uses: softprops/action-gh-release@v2
78-
with:
79-
tag_name: ${{ steps.get_tag.result }}
80-
files: |
81-
target/debian/*.deb
82-
target/release/*.rpm
83-
env:
84-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
- name: Upload release assets
69+
# Only run on release or manual dispatch
70+
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
71+
uses: softprops/action-gh-release@v2
72+
with:
73+
tag_name: ${{ steps.get_tag.result }}
74+
files: |
75+
target/debian/*.deb
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)