This repository has been archived by the owner on Jun 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
154 lines (129 loc) · 5.51 KB
/
release.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
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: droidian rootfs-builder
on:
workflow_dispatch:
push:
tags:
- '**'
schedule:
- cron: "59 23 * * *"
jobs:
once:
runs-on: ubuntu-20.04
name: Create GitHub release
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}${{ steps.create_nightly.outputs.upload_url }}
steps:
- name: Create Release
id: create_release
if: startsWith(github.ref, 'refs/tags/droidian')
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: false
- uses: dev-drprasad/[email protected]
if: startsWith(github.ref, 'refs/tags/droidian') != true
with:
delete_release: true # default: false
tag_name: nightly # tag name to delete
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Tag snapshot
if: startsWith(github.ref, 'refs/tags/droidian') != true
uses: tvdias/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
tag: nightly
- name: Create Release
id: create_nightly
if: startsWith(github.ref, 'refs/tags/droidian') != true
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly
release_name: nightly
draft: false
prerelease: true
build:
runs-on: ubuntu-20.04
needs: once
strategy:
fail-fast: true
matrix:
arch: [amd64]
template: [rootfs-builder]
dist: [bookworm]
namespace: [droidian]
debos_arch: [amd64,arm64]
name: ${{ matrix.template }}:${{ matrix.dist }} on ${{ matrix.debos_arch }}
steps:
- name: Get current date
run: echo "current_date=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Set suffix
run: echo "release_suffix=_${{ env.current_date }}" >> $GITHUB_ENV
- name: Set nightly version
if: startsWith(github.ref, 'refs/tags/droidian') != true
run: echo "version=nightly" >> $GITHUB_ENV
- name: Set version
if: startsWith(github.ref, 'refs/tags/droidian') == true
run: echo "version=$(echo ${{ github.ref }} | rev | cut -d'/' -f1 | rev)" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init --recursive
- name: QEMU set-up
uses: docker/setup-qemu-action@v1
- name: Create build dir
run: mkdir -p /tmp/buildd-results
- name: Pull container
run: docker pull quay.io/${{ matrix.namespace }}/${{ matrix.template }}:${{ matrix.dist }}-${{ matrix.arch }}
- name: Start Container
run: echo CONTAINER_HASH=$(docker run --detach --privileged -v /tmp/buildd-results:/buildd -v /dev:/dev -v /sys/fs/cgroup:/sys/fs/cgroup -v ${PWD}:/buildd/sources --security-opt seccomp:unconfined quay.io/${{ matrix.namespace }}/${{ matrix.template }}:${{ matrix.dist }}-${{ matrix.arch }} /sbin/init) >> $GITHUB_ENV
- name: Build rootfs
run: docker exec $CONTAINER_HASH /bin/sh -c 'cd /buildd/sources; debos -t architecture:${{ matrix.debos_arch }} -t suffix:${{ env.release_suffix }} -t version:${{ env.version }} device.yml'
- name: Upload Rootfs image
id: upload-rootfs
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.once.outputs.upload_url }}
asset_path: ./droidian-rootfs-api28gsi-${{ matrix.debos_arch }}${{ env.release_suffix }}.zip
asset_name: droidian-rootfs-api28gsi-${{ matrix.debos_arch }}${{ env.release_suffix }}.zip
asset_content_type: application/gzip
- name: "Check devtools file existence"
id: check_devtools
uses: andstor/file-existence-action@v1
with:
files: "droidian-devtools-${{ matrix.debos_arch }}${{ env.release_suffix }}.zip"
- name: Upload devtools sideload
if: steps.check_devtools.outputs.files_exists == 'true'
id: upload-sideload
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.once.outputs.upload_url }}
asset_path: ./droidian-devtools-${{ matrix.debos_arch }}${{ env.release_suffix }}.zip
asset_name: droidian-devtools-${{ matrix.debos_arch }}${{ env.release_suffix }}.zip
asset_content_type: application/gzip
- name: "Check adaptation file existence"
id: check_adaptation_volla_yggdrasil
uses: andstor/file-existence-action@v1
with:
files: "droidian-adaptation-volla-yggdrasil-${{ matrix.debos_arch }}${{ env.release_suffix }}.zip"
- name: Upload adaptation-volla-yggdrasil sideload
if: steps.check_adaptation_volla_yggdrasil.outputs.files_exists == 'true'
id: upload-sideload-yggdrasil
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.once.outputs.upload_url }}
asset_path: ./droidian-adaptation-volla-yggdrasil-${{ matrix.debos_arch }}${{ env.release_suffix }}.zip
asset_name: droidian-adaptation-volla-yggdrasil-${{ matrix.debos_arch }}${{ env.release_suffix }}.zip
asset_content_type: application/gzip