-
Notifications
You must be signed in to change notification settings - Fork 3
136 lines (127 loc) · 3.81 KB
/
linux.yml
File metadata and controls
136 lines (127 loc) · 3.81 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
130
131
132
133
134
135
name: "Run Tests and Package"
on:
push:
pull_request:
jobs:
tests-linux:
runs-on: ubuntu-latest
strategy:
matrix:
vs: ["58", "59", "latest"]
py: ["39", "310"]
arch: ["i686", "x86_64"]
steps:
- uses: actions/checkout@v2.4.0
- uses: cachix/install-nix-action@v15
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v10
with:
name: vs-engine
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build -L .#checks.${{ matrix.arch }}-linux.check-python${{ matrix.py }}-vapoursynth${{ matrix.vs }}
tests-darwin:
runs-on: macos-latest
strategy:
matrix:
vs: ["58", "59", "latest"]
py: ["39", "310"]
steps:
- uses: actions/checkout@v2.4.0
- uses: cachix/install-nix-action@v15
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v10
with:
name: vs-engine
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build -L .#checks.x86_64-darwin.check-python${{ matrix.py }}-vapoursynth${{ matrix.vs }}
tests-windows:
runs-on: windows-latest
strategy:
matrix:
vs: ["58", "59"]
arch: ["x64", "x86"]
include:
- vs: "58"
python: "3.10"
- vs: "59"
python: "3.10"
steps:
- uses: actions/checkout@v2.4.0
- name: Install Python ${{ matrix.python }}
uses: actions/setup-python@v3
with:
python-version: "${{ matrix.python }}"
architecture: "${{ matrix.arch }}"
- name: Installing dependencies
run: |
pip install flit
pip install vapoursynth==${{ matrix.vs }} vapoursynth_portable==${{ matrix.vs }}
flit install --user --pth-file
- name: Running Tests
run: |
python -m unittest discover -s ./tests/ -v
build:
runs-on: ubuntu-latest
needs:
- tests-linux
- tests-darwin
- tests-windows
steps:
# Set-up runner.
- uses: actions/checkout@v2.4.0
- name: Set outputs
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Check outputs
run: echo ${{ steps.vars.outputs.sha_short }}
- uses: cachix/install-nix-action@v15
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v10
with:
name: vs-engine
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
# Replace the dirty-tag with the commit-id.
- if: "!(github.event_name == 'push' && contains(github.ref, 'refs/tags/'))"
run: |
cat pyproject.toml | sed 's/\(version = "\)\(.*\)+dirty\("\)/\1\2.dev0+${{ steps.vars.outputs.sha_short }}\3/g' > pyproject.toml.tagged
cat pyproject.toml.tagged
mv pyproject.toml.tagged pyproject.toml
# Remove the dirty-tag from the builder.
- if: "github.event_name == 'push' && contains(github.ref, 'refs/tags/')"
run: |
cat pyproject.toml | sed 's/\(version = "\)\(.*\)+dirty\("\)/\1\2\3/g' > pyproject.toml.tagged
cat pyproject.toml.tagged
mv pyproject.toml.tagged pyproject.toml
# Build the distribution.
- run: nix build -L .#dist
- run: |
mkdir dist
cp result/* dist
ls -lAh dist
- name: Archive distribution
uses: actions/upload-artifact@v3
with:
name: Packages
path: |
dist/**/*
publish:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: build
steps:
- uses: actions/download-artifact@v3
with:
name: Packages
path: dist
- name: Install twine
run: |
pip install twine
- name: Upload VapourSynth
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload dist/*