-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (59 loc) · 2.38 KB
/
export_flatpakref.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
on:
repository_dispatch:
workflow_dispatch:
inputs:
arg_packname:
description: '.flatpakref文件地址'
required: true
default: ''
arg_repopath:
description: '实际安装路径, 默认即可'
required: true
default: '/var/lib/flatpak/repo'
arg_export_all:
description: '是否导出所有相关依赖包'
required: true
default: 'false'
name: install .flatpakref
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Initialization environment
run: |
echo $(nproc)
free -h
sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo -E apt-get -qq update
sudo -E apt-get -qq install flatpak
- name: install app
run: |
sudo -E apt-get -qq install flatpak
sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
sudo flatpak install ${{ github.event.inputs.arg_packname }} -y
- name: export .flatpak app
if: github.event.inputs.arg_export_all != 'true'
run: |
# 导出app
sudo flatpak list --app --columns=application,branch|awk '{printf "sudo flatpak build-bundle ${{ github.event.inputs.arg_repopath }} "$1"_"$2".flatpak "$1" "$2"\n"}'|xargs -I {} bash -c {}
- name: export .flatpak app and runtime
if: github.event.inputs.arg_export_all == 'true'
run: |
# 导出app
sudo flatpak list --app --columns=application,branch|awk '{printf "sudo flatpak build-bundle ${{ github.event.inputs.arg_repopath }} "$1"_"$2".flatpak "$1" "$2"\n"}'|xargs -I {} bash -c {}
# 导出runtime
sudo flatpak list --runtime --columns=application,branch|awk '{printf "sudo flatpak build-bundle ${{ github.event.inputs.arg_repopath }} --runtime "$1"_"$2".flatpak "$1" "$2"\n"}'|xargs -I {} bash -c {}
- name: Release set path
run: |
echo "${{ github.event.inputs.arg_packname }}">>release.txt
md5sum ./*.flatpak>>release.txt
echo "RELEASE_PATH=$PWD" >> $GITHUB_ENV
echo "FILE_DATE=$(date +"%Y%m%d%H%M")" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.FILE_DATE }}
body_path: release.txt
files: ${{ env.RELEASE_PATH }}/*.flatpak