-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (127 loc) · 4.52 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
on:
push:
tags:
- '*'
workflow_dispatch:
name: pu32-toolchain
jobs:
job0:
name: Release
runs-on: ubuntu-20.04
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive
- name: Build project
working-directory: ../
run: |
sudo ln -snf /bin/bash /bin/sh
sudo mount --bind /${PWD} /opt/
sudo mkdir -p /opt/pu32-toolchain/
sudo chown ${UID} /opt/pu32-toolchain/
PATH="${PATH}:/opt/pu32-toolchain/bin" make USETAR=1 -f pu32/makefile > pu32/build.log
PATH="${PATH}:/opt/pu32-toolchain/bin" pu32-mksocimg -k pu32-vmlinux.bin -r pu32-rootfs.ext2 pu32.img
xz pu32-vmlinux.elf pu32-vmlinux.bin pu32-rootfs.ext2 pu32.img
mv *.xz pu32/
- name: Save build.log
uses: actions/upload-artifact@v2
with:
path: build.log
name: build.log
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Save pu32-toolchain.tar.xz
if: startsWith(github.ref, 'refs/heads/')
uses: actions/upload-artifact@v2
with:
path: pu32-toolchain.tar.xz
name: pu32-toolchain.tar.xz
- name: Upload pu32-toolchain.tar.xz
if: startsWith(github.ref, 'refs/tags/')
id: upload-pu32-toolchain-tar-xz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: pu32-toolchain.tar.xz
asset_name: pu32-toolchain.tar.xz
asset_content_type: application/tar+xz
- name: Save pu32-vmlinux.elf.xz
if: startsWith(github.ref, 'refs/heads/')
uses: actions/upload-artifact@v2
with:
path: pu32-vmlinux.elf.xz
name: pu32-vmlinux.elf.xz
- name: Upload pu32-vmlinux.elf.xz
if: startsWith(github.ref, 'refs/tags/')
id: upload-vmlinux-xz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: pu32-vmlinux.elf.xz
asset_name: pu32-vmlinux.elf.xz
asset_content_type: application/x-xz
- name: Save pu32-vmlinux.bin.xz
if: startsWith(github.ref, 'refs/heads/')
uses: actions/upload-artifact@v2
with:
path: pu32-vmlinux.bin.xz
name: pu32-vmlinux.bin.xz
- name: Upload pu32-vmlinux.bin.xz
if: startsWith(github.ref, 'refs/tags/')
id: upload-vmlinux-bin-xz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: pu32-vmlinux.bin.xz
asset_name: pu32-vmlinux.bin.xz
asset_content_type: application/x-xz
- name: Save pu32-rootfs.ext2.xz
if: startsWith(github.ref, 'refs/heads/')
uses: actions/upload-artifact@v2
with:
path: pu32-rootfs.ext2.xz
name: pu32-rootfs.ext2.xz
- name: Upload pu32-rootfs.ext2.xz
if: startsWith(github.ref, 'refs/tags/')
id: upload-rootfs-ext2-xz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: pu32-rootfs.ext2.xz
asset_name: pu32-rootfs.ext2.xz
asset_content_type: application/x-xz
- name: Save pu32.img.xz
if: startsWith(github.ref, 'refs/heads/')
uses: actions/upload-artifact@v2
with:
path: pu32.img.xz
name: pu32.img.xz
- name: Upload pu32.img.xz
if: startsWith(github.ref, 'refs/tags/')
id: upload-vmlinux-img-xz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: pu32.img.xz
asset_name: pu32.img.xz
asset_content_type: application/x-xz