forked from Farama-Foundation/Arcade-Learning-Environment
-
Notifications
You must be signed in to change notification settings - Fork 1
122 lines (105 loc) · 3.27 KB
/
wheels.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
119
120
121
122
name: Wheels
on:
push:
tags:
- 'v*'
jobs:
build:
name: ${{ matrix.runs-on }} • ${{ matrix.arch }}
defaults:
run:
shell: bash
strategy:
matrix:
include:
- runs-on: ubuntu-latest
arch: x86_64
- runs-on: windows-latest
arch: AMD64
- runs-on: macos-latest
arch: x86_64
- runs-on: macos-latest
arch: arm64
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v2
- name: Setup Docker
if: runner.os == 'Linux'
run: docker login ghcr.io --username "${GITHUB_ACTOR}" --password "${GITHUB_CR_TOKEN}"
env:
GITHUB_CR_TOKEN: ${{ secrets.CR_TOKEN }}
- name: Setup msbuild
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v1.1
# TODO(jfarebro): 02/16/2023 - There's a bug where pkg-config isn't installed on the macOS
# runner. See: https://github.com/actions/runner-images/pull/7125
- name: Install pkg-config on macOS
if: runner.os == 'macOS'
run: brew install pkg-config
- name: Setup vcpkg
if: runner.os == 'macOS' || runner.os == 'Windows'
uses: lukka/run-vcpkg@v10
with:
vcpkgGitCommitId: "9aa0d66373ce3a6868d12353d0d4960db0d4bd18"
# There's a permissions issue with the cache
# https://github.com/microsoft/vcpkg/issues/20121
doNotCache: true
- name: Build wheels
uses: pypa/cibuildwheel@v2.12.0
env:
CIBW_ARCHS: "${{ matrix.arch }}"
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: ./wheelhouse/*.whl
pypi:
name: Deploy wheels to PyPi test
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v1
with:
name: wheels
- name: Append PyPi test SHA
run: |
find wheels -type f -exec sh -c \
"mv {} \$(echo {} | awk -F\"-\" '{OFS = FS; \$2 = \$2\"+${GITHUB_SHA::7}\"; print}')" \;
- name: Publish to PyPi test
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TEST_TOKEN }}
repository_url: https://test.pypi.org/legacy/
packages_dir: wheels/
print_hash: true
release:
name: Stage wheels to Github releases
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v1
with:
name: wheels
- name: Create wheel archive
run: |
zip --junk-paths wheels wheels/*
- name: Create release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: ${{ contains(github.ref, '-') }}
- name: Upload artifacts to release
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./wheels.zip
asset_name: wheels.zip
asset_content_type: application/zip