This repository has been archived by the owner on Aug 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (102 loc) · 3.32 KB
/
build.yaml
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
name: build
on:
workflow_dispatch:
push:
jobs:
build:
strategy:
matrix:
target: [debian, binary]
fail-fast: false
name: Build for ${{ matrix.target }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.7
- name: Init Rust
shell: bash
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
. "$HOME/.cargo/env"
- name: Create Package (binary)
if: matrix.target == 'binary'
shell: bash
run: cargo build --release --verbose
- name: Create Package (debian)
if: matrix.target == 'debian'
shell: bash
run: |
cargo install cargo-deb
cargo deb
- name: Output the result (binary)
if: matrix.target == 'binary'
uses: actions/upload-artifact@v4.3.4
with:
name: pbskids-dl-rs_${{ runner.arch }}
path: target/release/pbskids-dl
if-no-files-found: error
- name: Output the result (debian)
if: matrix.target == 'debian'
uses: actions/upload-artifact@v4.3.4
with:
name: pbskids-dl-rs_${{ runner.arch }}.deb
path: target/debian/pbskids-dl.rs_*-1_*.deb
if-no-files-found: error
release:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/download-artifact@v4.1.8
- name: Update Nightly Release
uses: andelf/nightly-release@46e2d5f80828ecc5c2c3c819eb31186a7cf2156c
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: unstable
name: 'Unstable'
prerelease: true
body: 'Unstable release of pbskids-dl.rs for commit ${{ github.sha }} (SAME ARCH FOR EVERY FILE)'
files: |
./pbskids-dl-rs*/*
# test:
# strategy:
# matrix:
# target: [debian]
# fail-fast: false
# needs: build
# name: Test for ${{ matrix.target }}
# runs-on: ubuntu-latest
# steps:
# - name: Init tools
# uses: actions/checkout@v4.1.7
# with:
# submodules: true # This line is only needed for building/testing a package, pretty much useless otherwise.
# - name: Download the result
# uses: actions/download-artifact@v4.1.8
# - name: Verify SHA256sum (debian)
# if: matrix.target == 'debian'
# shell: bash
# run: |
# cd $GITHUB_WORKSPACE
# mv ./pbskids-dl_debian.sha256sum ./pbskids-dl_debian.sha256sum.2
# cp ./pbskids-dl_debian.sha256sum.2/pbskids-dl.sha256sum ./pbskids-dl_debian.sha256sum
# mv ./pbskids-dl_debian.deb ./pbskids-dl_debian.deb.2
# cp ./pbskids-dl_debian.deb.2/pbskids-dl_debian.deb ./pbskids-dl_debian.deb
# cat ./pbskids-dl_debian.sha256sum | sha256sum --check
# - name: Install Packages (debian)
# if: matrix.target == 'debian'
# shell: bash
# run: |
# cd $GITHUB_WORKSPACE
# sudo apt-get update
# sudo apt-get install ./pbskids-dl_debian.deb -y
# python3 -m pip install -r requirements.txt
# - name: Test Build (debian)
# if: matrix.target == 'debian'
# shell: bash
# run: |
# cd ./.debian
# sudo chmod +x ./filetest.sh
# ./filetest.sh ./pbskidsdl_testers.txt