-
Notifications
You must be signed in to change notification settings - Fork 1
130 lines (118 loc) · 3.96 KB
/
sas_debian_builder.yml
File metadata and controls
130 lines (118 loc) · 3.96 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: SAS Debian Builder
on: [push,workflow_dispatch]
jobs:
debian_builder:
name: Debian Builder
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-24.04', 'ubuntu-24.04-arm']
outputs:
version: ${{ steps.extract.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build image
run: |
cd .devel
chmod +x build_container.sh && ./build_container.sh sas_deb_builder
- name: Extract debian files
id: extract
run: |
cd .devel
chmod +x extract_debian_from_container.sh && ./extract_debian_from_container.sh
cd upload/extract
cat SAS_VERSION >> "$GITHUB_OUTPUT"
- name: Upload
uses: actions/upload-artifact@v4
with:
name: debian-packages-${{ matrix.os }}
path: .devel/upload/extract/*
gh_release:
needs: debian_builder
name: Create Release on GitHub
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4 # Download all artifacts
with:
path: release/
merge-multiple: true
- name: Create release
env:
VERSION: ${{needs.debian_builder.outputs.version}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd release
gh release create v"$VERSION" \
*.*deb \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${VERSION}" \
--generate-notes
build_ppa:
name: Build PPA
needs: debian_builder
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4 # Download all artifacts
with:
path: ppa/
merge-multiple: true
- name: Create package files # https://assafmo.github.io/2019/05/02/ppa-repo-hosted-on-github.html
env:
PGP_PRIVATE_KEY: ${{ secrets.PGP_PRIVATE_KEY }}
run: |
cd ppa
ls -lah
echo -e "$PGP_PRIVATE_KEY" | gpg --import
gpg --armor --export "murilomarinho@ieee.org" > KEY.gpg
dpkg-scanpackages --multiversion . > Packages
dpkg-scanpackages --multiversion --type ddeb . >> Packages
gzip -k -f Packages
apt-ftparchive release . > Release
gpg --default-key "murilomarinho@ieee.org" -abs -o - Release > Release.gpg
gpg --default-key "murilomarinho@ieee.org" --clearsign -o - Release > InRelease
echo "deb [signed-by=/etc/apt/trusted.gpg.d/smartarmstack_lgpl.gpg] https://smartarmstack.github.io/smart_arm_stack_ROS2 ./" > smartarmstack_lgpl.list
tree -H '.' -L 1 --noreport --charset utf-8 | sed -e '/<hr>/,+7d' > index.html
ls -lah
- name: Upload PPA Files
uses: actions/upload-pages-artifact@v3
with:
path: ppa/
deploy_ppa_page:
name: Deploy PPA
needs: build_ppa
permissions:
contents: read
pages: write
id-token: write
runs-on: ubuntu-latest
steps:
- name: Configure Pages
uses: actions/configure-pages@v4
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
deploy_docker_image:
name: Deploy Docker Image with SAS
needs: deploy_ppa_page
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push sas
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
file: .devel/sas/Dockerfile
#cache-from: type=gha
#cache-to: type=gha,mode=max
tags: ${{ vars.DOCKER_USERNAME }}/sas:jazzy