Skip to content

Commit fa78ba2

Browse files
committed
Rework workflow to minimize intermediate files.
1 parent 5fff126 commit fa78ba2

File tree

1 file changed

+45
-61
lines changed

1 file changed

+45
-61
lines changed

.github/workflows/release.yaml

Lines changed: 45 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,9 @@ on:
88
- '*-b*'
99

1010
jobs:
11-
build:
12-
runs-on: macOS-latest
13-
strategy:
14-
max-parallel: 4
15-
matrix:
16-
target: ['macOS', 'iOS', 'tvOS', 'watchOS']
11+
make-release:
12+
runs-on: ubuntu-latest
1713
steps:
18-
- uses: actions/checkout@v2
1914
- name: Set build variables
2015
env:
2116
TAG_NAME: ${{ github.ref }}
@@ -29,20 +24,34 @@ jobs:
2924
echo "::set-env name=TAG::${TAG}"
3025
echo "::set-env name=PY_VERSION::${TAG_VERSION}"
3126
echo "::set-env name=BUILD_NUMBER::${TAG_BUILD}"
32-
- name: Build project
27+
- name: Create Release
28+
id: create_release
29+
uses: actions/create-release@v1
3330
env:
34-
BUILD_NUMBER: ${{ env.BUILD_NUMBER }}
35-
run: make -e ${{ matrix.target }}
36-
- name: Upload build artefact
37-
uses: actions/upload-artifact@v1
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3832
with:
39-
name: ${{ matrix.target }}
40-
path: ./dist/Python-${{ env.PY_VERSION }}-${{ matrix.target }}-support.${{ env.BUILD_NUMBER }}.tar.gz
33+
tag_name: ${{ github.ref }}
34+
release_name: ${{ github.ref }}
35+
draft: true
36+
prerelease: false
37+
body: |
38+
Build ${{ env.BUILD_NUMBER }} of the BeeWare support package for Python ${{ env.PY_VERSION }}.
4139
42-
release:
43-
runs-on: ubuntu-latest
44-
needs: build
40+
Includes:
41+
* Python ${{ env.PY_VERSION }}.?
42+
* ...
43+
outputs:
44+
upload_url: ${{ steps.create_release.outputs.upload_url }}
45+
46+
build:
47+
runs-on: macOS-latest
48+
needs: make-release
49+
strategy:
50+
max-parallel: 4
51+
matrix:
52+
target: ['macOS', 'iOS', 'tvOS', 'watchOS']
4553
steps:
54+
- uses: actions/checkout@v2
4655
- name: Set build variables
4756
env:
4857
TAG_NAME: ${{ github.ref }}
@@ -56,53 +65,28 @@ jobs:
5665
echo "::set-env name=TAG::${TAG}"
5766
echo "::set-env name=PY_VERSION::${TAG_VERSION}"
5867
echo "::set-env name=BUILD_NUMBER::${TAG_BUILD}"
59-
- name: Download build artefacts
60-
uses: actions/download-artifact@v2
61-
- name: Display structure of downloaded files
62-
run: ls -R
63-
- name: Create Release
64-
id: create_release
65-
uses: actions/create-release@v1
66-
env:
67-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68-
with:
69-
tag_name: ${{ github.ref }}
70-
release_name: ${{ github.ref }}
71-
draft: true
72-
prerelease: false
73-
- name: Upload macOS Release Asset to Github
74-
uses: actions/upload-release-asset@v1
75-
env:
76-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77-
with:
78-
upload_url: ${{ steps.create_release.outputs.upload_url }}
79-
asset_path: ./macOS/Python-${{ env.PY_VERSION }}-macOS-support.${{ env.BUILD_NUMBER }}.tar.gz
80-
asset_name: Python-${{ env.PY_VERSION }}-macOS-support.${{ env.BUILD_NUMBER }}.tar.gz
81-
asset_content_type: application/gzip
82-
- name: Upload iOS Release Asset to Github
83-
uses: actions/upload-release-asset@v1
68+
- name: Build ${{ matrix.target }}
8469
env:
85-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86-
with:
87-
upload_url: ${{ steps.create_release.outputs.upload_url }}
88-
asset_path: ./iOS/Python-${{ env.PY_VERSION }}-iOS-support.${{ env.BUILD_NUMBER }}.tar.gz
89-
asset_name: Python-${{ env.PY_VERSION }}-iOS-support.${{ env.BUILD_NUMBER }}.tar.gz
90-
asset_content_type: application/gzip
91-
- name: Upload tvOS Release Asset to Github
92-
uses: actions/upload-release-asset@v1
93-
env:
94-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95-
with:
96-
upload_url: ${{ steps.create_release.outputs.upload_url }}
97-
asset_path: ./tvOS/Python-${{ env.PY_VERSION }}-tvOS-support.${{ env.BUILD_NUMBER }}.tar.gz
98-
asset_name: Python-${{ env.PY_VERSION }}-tvOS-support.${{ env.BUILD_NUMBER }}.tar.gz
99-
asset_content_type: application/gzip
100-
- name: Upload watchOS Release Asset to Github
70+
BUILD_NUMBER: ${{ env.BUILD_NUMBER }}
71+
run: |
72+
# 2020-05-29: The iOS 13.4 SDK changed the implementation of FD_SET
73+
# to use a weak linked symbol (__darwin_check_fd_set_overflow).
74+
# This means any support package built against that SDK is incompatible
75+
# with linking against an earlier SDK.
76+
# However, you can't get the iOS 13.4 SDK on macOS Mojave (10.14),
77+
# because the latest XCode supported on Mojave (11.3.1) only provided
78+
# SDK 13.2.
79+
# So: We force the use of XCode 11.3.1, which ships with the 13.2 SDK.
80+
# For a list of SDKs available on Github Actions, see:
81+
# https://github.com/actions/virtual-environments/blob/master/images/macos/macos-10.15-Readme.md
82+
sudo xcode-select --switch /Applications/Xcode_11.3.1.app
83+
make -e ${{ matrix.target }}
84+
- name: Upload ${{ matrix.target }} release asset
10185
uses: actions/upload-release-asset@v1
10286
env:
10387
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10488
with:
105-
upload_url: ${{ steps.create_release.outputs.upload_url }}
106-
asset_path: ./watchOS/Python-${{ env.PY_VERSION }}-watchOS-support.${{ env.BUILD_NUMBER }}.tar.gz
107-
asset_name: Python-${{ env.PY_VERSION }}-watchOS-support.${{ env.BUILD_NUMBER }}.tar.gz
89+
upload_url: ${{ needs.make-release.outputs.upload_url }}
90+
asset_path: ./dist/Python-${{ env.PY_VERSION }}-${{ matrix.target }}-support.${{ env.BUILD_NUMBER }}.tar.gz
91+
asset_name: Python-${{ env.PY_VERSION }}-${{ matrix.target }}-support.${{ env.BUILD_NUMBER }}.tar.gz
10892
asset_content_type: application/gzip

0 commit comments

Comments
 (0)