-
Notifications
You must be signed in to change notification settings - Fork 24
118 lines (105 loc) · 4.01 KB
/
build.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Build eggs
on:
push:
branches: [deluge-2.1.1]
jobs:
release:
name: Create Github Release
# if: contains(github.ref, 'tags/v')
# needs: [test]
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Deluge 2.1.1
draft: true
prerelease: false
- name: Output Release URL File
run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt
- name: Save Release URL File for publish
uses: actions/upload-artifact@v1
with:
name: release_url
path: release_url.txt
build:
runs-on: ubuntu-latest
needs: [release]
strategy:
# By default, GitHub will maximize the number of jobs run in parallel
# depending on the available runners on GitHub-hosted virtual machines.
# max-parallel: 8
fail-fast: false
matrix:
include:
- python-version: "3.7"
- python-version: "3.8"
- python-version: "3.9"
- python-version: "3.10"
- python-version: "3.11"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v1
- name: Load Release URL File from release job
uses: actions/download-artifact@v4.1.7
with:
name: release_url
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Python build
run: |
echo "Python ${{ matrix.python-version }}"
python --version
PYTHON_VERSION=${{ matrix.python-version }} ./build-all.sh
ls -alh out
ls -alh out/dist
- name: Get md5sum
run: |
echo "::set-output name=FILEHASH::$(md5sum ./out/dist/Telegramer-2.1.1.0-py${{ matrix.python-version }}.egg | cut -d ' ' -f 1)"
id: filehash
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
# with:
# body: "**MD5:** `${{ steps.filehash.outputs.FILEHASH }}`"
# tag_name: v2.1.1
# release_name: Deluge 2.1.1
# draft: true
# prerelease: true
- name: Get Release File Name & Upload URL
id: get_release_info
run: |
echo ::set-output name=file_name::${REPOSITORY_NAME##*/}-${TAG_REF_NAME##*/v} # RepositoryName-v1.0.0
value=`cat release_url/release_url.txt`
echo ::set-output name=upload_url::$value
env:
TAG_REF_NAME: ${{ github.ref }}
REPOSITORY_NAME: ${{ github.repository }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ./out/dist/Telegramer-2.1.1.0-py${{ matrix.python-version }}.egg
asset_name: 'Telegramer-2.1.1.0-py${{ matrix.python-version }}.egg'
asset_content_type: application/octet-stream
# - name: Upload Release Asset
# id: upload-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: ./out/dist/Telegramer-2.1.1.0-py${{ matrix.python-version }}.egg
# asset_name: 'Telegramer-2.1.1.0-py${{ matrix.python-version }}.egg'
# asset_content_type: application/octet-stream