-
Notifications
You must be signed in to change notification settings - Fork 289
107 lines (104 loc) · 4.05 KB
/
semantic_release.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
name: semantic_release
on:
push:
branches:
- master
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master
token: ${{ secrets.GH_TOKEN }}
- name: Download lokalise translations
run: |
docker run -v /tmp/lokalise:/opt/dest lokalise/lokalise-cli-2 lokalise2 \
--token "${{ secrets.lokalise_token }}" \
--project-id 465185555eee18dd537ca6.39714580 file download \
--format json \
--unzip-to /opt/dest \
--original-filenames=false \
--export-sort a_z \
--placeholder-format icu \
--json-unescaped-slashes=true \
--indentation 2sp \
--export-empty-as base \
--add-newline-eof \
--replace-breaks=false
- name: Move new translations
run: |
cp /tmp/lokalise/locale/* /home/runner/work/alexa_media_player/alexa_media_player/custom_components/alexa_media/translations/
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
# #----------------------------------------------
# # ----- install & configure poetry -----
# #----------------------------------------------
# - name: Install Poetry
# uses: snok/install-poetry@v1
# with:
# virtualenvs-create: true
# virtualenvs-in-project: true
# installer-parallel: true
# #----------------------------------------------
# # load cached venv if cache exists
# #----------------------------------------------
# - name: Load cached venv
# id: cached-poetry-dependencies
# uses: actions/cache@v2
# with:
# path: .venv
# key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
# #----------------------------------------------
# # install dependencies if cache does not exist
# #----------------------------------------------
# - name: Install dependencies
# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
# run: poetry install --no-interaction --no-root
# #----------------------------------------------
# # install your root project, if required
# #----------------------------------------------
# - name: Install library
# run: poetry install --no-interaction
- name: Setup Git
run: |
git config --global user.name "semantic-release"
git config --global user.email "semantic-release@GitHub"
- name: Commit translation files
continue-on-error: true
run: |
git add custom_components/alexa_media/translations/*.json
git commit -m "docs: update localization" -a
- name: Python Semantic Release
uses: relekang/[email protected]
with:
github_token: ${{ secrets.GH_TOKEN }}
# Pack the alexa_media_player dir as a zip and upload to the release
- name: Zip alexa_media dir
run: |
cd /home/runner/work/alexa_media_player/alexa_media_player/custom_components/alexa_media
zip alexa_media.zip -r ./
- name: Set release variable
run: |
echo "release_version=`git describe --abbrev=0`" >> $GITHUB_ENV
- name: Sleep
# add delay so upload does not kill the release notes from semantic-release
run: |
sleep 5
- name: Upload zip to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GH_TOKEN }}
file: /home/runner/work/alexa_media_player/alexa_media_player/custom_components/alexa_media/alexa_media.zip
asset_name: alexa_media.zip
tag: ${{ env.release_version }}
overwrite: true
- name: Push changes to dev
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: dev