-
Notifications
You must be signed in to change notification settings - Fork 2
123 lines (120 loc) · 5.53 KB
/
release.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Release
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
strategy:
matrix:
include:
- OS: ubuntu-22.04
PYTHON_VERSION: 3.10.9
BUILD_CMD: |
export PYTHONHASHSEED=42
export BUILD_FILE_NAME=eth-duties-${RELEASE_VERSION}-ubuntu2204-amd64;
mkdir ${BUILD_FILE_NAME};
poetry run pyinstaller --clean --onefile --add-data config:config --name eth-duties --distpath ./${BUILD_FILE_NAME} ./duties/main.py;
tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME};
mkdir /tmp/artifacts;
cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts;
sha256sum ${BUILD_FILE_NAME}.tar.gz | head -c 64 > /tmp/artifacts/${BUILD_FILE_NAME}.sha256;
- OS: ubuntu-20.04
PYTHON_VERSION: 3.10.9
BUILD_CMD: |
export PYTHONHASHSEED=42
export BUILD_FILE_NAME=eth-duties-${RELEASE_VERSION}-ubuntu2004-amd64;
mkdir ${BUILD_FILE_NAME};
poetry run pyinstaller --clean --onefile --add-data config:config --name eth-duties --distpath ./${BUILD_FILE_NAME} ./duties/main.py;
tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME};
mkdir /tmp/artifacts;
cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts;
sha256sum ${BUILD_FILE_NAME}.tar.gz | head -c 64 > /tmp/artifacts/${BUILD_FILE_NAME}.sha256;
- OS: macos-latest
PYTHON_VERSION: 3.10.9
BUILD_CMD: |
export PYTHONHASHSEED=42
export BUILD_FILE_NAME=eth-duties-${RELEASE_VERSION}-darwin-amd64;
mkdir ${BUILD_FILE_NAME};
poetry run pyinstaller --clean --onefile --add-data config:config --name eth-duties --distpath ./${BUILD_FILE_NAME} ./duties/main.py;
tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME};
mkdir /tmp/artifacts;
cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts;
shasum -a 256 ${BUILD_FILE_NAME}.tar.gz | head -c 64 > /tmp/artifacts/${BUILD_FILE_NAME}.sha256
- OS: windows-latest
PYTHON_VERSION: 3.10.9
BUILD_CMD: |
source $VENV
export PYTHONHASHSEED=42
export BUILD_FILE_NAME=eth-duties-${RELEASE_VERSION}-windows-amd64;
mkdir ${BUILD_FILE_NAME};
poetry run pyinstaller --clean --onefile --add-data "config;config" --name eth-duties --distpath ./${BUILD_FILE_NAME} ./duties/main.py;
tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME};
mkdir /tmp/artifacts;
cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts;
sha256sum ${BUILD_FILE_NAME}.tar.gz | head -c 64 > /tmp/artifacts/${BUILD_FILE_NAME}.sha256;
defaults:
run:
shell: bash
runs-on: ${{ matrix.OS }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Get the version
id: get_version
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT
- name: Build executable for ${{ matrix.OS }}
env:
RELEASE_VERSION: ${{ steps.get_version.outputs.VERSION }}
run: ${{ matrix.BUILD_CMD }}
- name: Upload windows artifacts
if: matrix.OS == 'windows-latest'
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.OS }}
path: C:\Users\runneradmin\AppData\Local\Temp\artifacts\*
if-no-files-found: error
- name: Upload UNIX artifacts
if: matrix.OS != 'windows-latest'
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.OS }}
path: /tmp/artifacts/*
if-no-files-found: error
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: /tmp/artifacts
- name: Display structure of downloaded files
run: ls -R
working-directory: /tmp/artifacts
- name: Get the version
id: get_version
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT
- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
fail_on_unmatched_files: true
files: |
/tmp/artifacts/ubuntu-22.04/eth-duties-${{ steps.get_version.outputs.VERSION }}-ubuntu2204-amd64.tar.gz
/tmp/artifacts/ubuntu-22.04/eth-duties-${{ steps.get_version.outputs.VERSION }}-ubuntu2204-amd64.sha256
/tmp/artifacts/ubuntu-20.04/eth-duties-${{ steps.get_version.outputs.VERSION }}-ubuntu2004-amd64.tar.gz
/tmp/artifacts/ubuntu-20.04/eth-duties-${{ steps.get_version.outputs.VERSION }}-ubuntu2004-amd64.sha256
/tmp/artifacts/macos-latest/eth-duties-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.tar.gz
/tmp/artifacts/macos-latest/eth-duties-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.sha256
/tmp/artifacts/windows-latest/eth-duties-${{ steps.get_version.outputs.VERSION }}-windows-amd64.tar.gz
/tmp/artifacts/windows-latest/eth-duties-${{ steps.get_version.outputs.VERSION }}-windows-amd64.sha256