forked from delfick/photons
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (65 loc) · 2.67 KB
/
release-arranger.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
on:
- workflow_dispatch
name: Release Photons Arranger
jobs:
build:
name: Create the package
runs-on: ubuntu-latest
environment: github_release
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- uses: actions/setup-node@v2
with:
node-version: '12'
- id: build_assets
run: |
set -e
rm -rf arranger/static/dist/prod
python3 -m venv /tmp/photons
/tmp/photons/bin/python -m pip install -e modules
/tmp/photons/bin/python -m pip install -e apps/arranger
yarn add webpack-cli webpack
NODE_ENV=production /tmp/photons/bin/lifx arranger_assets static
if ! ls apps/arranger/arranger/static/dist/prod/static/*.js > /dev/null; then
ls -R apps/arranger/arranger/static/dist/prod
echo "Couldn't find any javascript!"
exit 1
fi
- id: see_built_assets
run: ls -R apps/arranger/arranger/static/dist
- id: sdist
run: cd apps/arranger && python setup.py sdist
- id: version
run: |
printf "::set-output name=version::%s\n" $(python -c "import runpy; print(runpy.run_path('apps/arranger/arranger/__init__.py')['VERSION'])")
printf "::set-output name=versiondash::%s\n" $(python -c "import runpy; print(runpy.run_path('apps/arranger/arranger/__init__.py')['VERSION'].replace('.', '-'))")
- id: package
run: >
printf "::set-output name=package::lifx-photons-arranger-${{ steps.version.outputs.version}}.tar.gz"
- id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "release-arranger-${{ steps.version.outputs.version }}"
release_name: Photons Arranger ${{ steps.version.outputs.version }}
body: "https://photons.delfick.com/apps/arranger/index.html#release-arranger-${{ steps.version.outputs.versiondash }}"
draft: false
prerelease: false
- id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: "apps/arranger/dist/${{ steps.package.outputs.package }}"
asset_name: ${{ steps.package.outputs.package }}
asset_content_type: application/tar+gzip
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN_ARRANGER }}
packages_dir: apps/arranger/dist