forked from cea-sec/openwec
-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (71 loc) · 2.75 KB
/
release-draft.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Generate Github release draft
on:
push:
tags:
- "v*"
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: build packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Make debian bookworm package
run: |
cd build-pkg && \
docker build -t openwec-builder:debian-bookworm -f Dockerfile-debian-bookworm . && \
docker run -t -u $(id -u):$(id -g) -v $(pwd)/../:/SRC \
--env CARGO_HOME=/SRC/target/.cargo openwec-builder:debian-bookworm \
sh -c "cargo build --release --locked && \
cargo deb --no-build --manifest-path=./common/Cargo.toml" && \
for i in ../target/debian/*.deb; do mv "$i" "${i/.deb/_deb12.deb}"; done;
- name: Upload debian bookworm package
uses: actions/upload-artifact@v4
with:
name: openwec-deb-bookworm-package
path: ./target/debian/*.deb
- name: Make debian bullseye package
run: |
cargo clean && \
cd build-pkg && \
docker build -t openwec-builder:debian-bullseye -f Dockerfile-debian-bullseye . && \
docker run -t -u $(id -u):$(id -g) -v $(pwd)/../:/SRC \
--env CARGO_HOME=/SRC/target/.cargo openwec-builder:debian-bullseye \
sh -c "cargo build --release --locked && \
cargo deb --no-build --manifest-path=./common/Cargo.toml" && \
for i in ../target/debian/*.deb; do mv "$i" "${i/.deb/_deb11.deb}"; done;
- name: Upload debian bullseye package
uses: actions/upload-artifact@v4
with:
name: openwec-deb-bullseye-package
path: ./target/debian/*.deb
# Need to select "Read and write permissions" under Actions / General / Workflow Permissions
release:
name: Github release draft
needs: [build]
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: write
steps:
- name: Download debian bookworm package
uses: actions/download-artifact@v4
with:
name: openwec-deb-bookworm-package
- name: Download debian bullseye package
uses: actions/download-artifact@v4
with:
name: openwec-deb-bullseye-package
- name: Get artifacts names
id: artifacts_names
run: |
echo "U_PKG_DEB_BOOKWORM=$(ls openwec*_deb12.deb)" >> "$GITHUB_OUTPUT" && \
echo "U_PKG_DEB_BULLSEYE=$(ls openwec*_deb11.deb)" >> "$GITHUB_OUTPUT"
- name: Create draft release
uses: softprops/action-gh-release@v2
with:
draft: true
files: |
${{ steps.artifacts_names.outputs.U_PKG_DEB_BOOKWORM }}
${{ steps.artifacts_names.outputs.U_PKG_DEB_BULLSEYE }}