-
Notifications
You must be signed in to change notification settings - Fork 98
99 lines (87 loc) · 2.89 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
name: release
on:
push:
tags-ignore:
- "v1"
- "v2"
- "v3"
- "v4"
jobs:
check:
runs-on: ubuntu-latest
outputs:
is_tag: ${{ steps.check.outputs.is_tag }}
steps:
- name: Check if it's a tagged release
id: check
run: |
REF=${{ github.ref }}
URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${REF##*/}"
StatusCode=$(curl -o /dev/null -I -L -s -w "%{http_code}" -X GET -G $URL)
echo $StatusCode
if [[ "$StatusCode" == 200 ]]; then
echo "This is tagged release!"
echo "IS_TAG=no" >> $GITHUB_OUTPUT
else
echo "This is a tag not release!"
echo "IS_TAG=yes" >> $GITHUB_OUTPUT
fi
build:
runs-on: ubuntu-latest
container: setsoft/kicad_pybuild:latest
needs: check
if: ${{ needs.check.outputs.IS_TAG == 'yes' }}
outputs:
DEB_NAME: ${{ steps.mdeb.outputs.DEB_NAME }}
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Build
id: mdeb
run: |
apt-get -y update
apt-get -y install --no-install-recommends python3-bs4 python3-future python3-lxml python3-requests python3-tqdm wget python3-pip python3-xlsxwriter python3-yaml
wget https://github.com/INTI-CMNB/KiCost/releases/download/v1.1.5rc1/python3-babel_2.9.0-1_all.deb
wget https://github.com/INTI-CMNB/KiCost/releases/download/v1.1.5rc5/python3-validators_0.14.2-2_all.deb
wget https://github.com/set-soft/kicost-digikey-api-v3/releases/download/v0.1.1/kicost-digikey-api-v3_0.1.1-1_all.deb
apt -y install --no-install-recommends ./*.deb
rm python3-babel*
cp requirements.txt requirements.txt.ok
sed -i 's/^wxPython/#wxPython/' requirements.txt
pip3 install -U .
cp requirements.txt.ok requirements.txt
make deb
mv ../*.deb .
echo "DEB_NAME="`ls *.deb` >> $GITHUB_OUTPUT
mkdir output
mv *.deb output
- name: Store
uses: actions/upload-artifact@v4
with:
name: package
path: output
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Retrieve
uses: actions/download-artifact@v4
with:
name: package
- name: Changelog
run: |
tools/history2changelog.py > CHANGELOG.md
- name: Release
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DRAFT_RELEASE: "true"
PRE_RELEASE: "true"
CHANGELOG_FILE: "CHANGELOG.md"
KICOST_RELEASE: "true"
with:
args: |
package/${{needs.build.outputs.DEB_NAME}}
package/python3-validators_0.14.2-2_all.deb