-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (70 loc) · 2.65 KB
/
release.yml
File metadata and controls
84 lines (70 loc) · 2.65 KB
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Release
on:
push:
tags:
- 'v*'
jobs:
upload-release:
runs-on: ubuntu-latest
steps:
- name: checkout branch
uses: actions/checkout@v1
- name: install python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- name: install requirments
run: pip install -r requirements.txt
- name: run python script for build firmware
run: python build.py ${{ github.ref_name }}
- name: upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ github.ref_name }}
path: build/${{ github.ref_name }}.zip
retention-days: 1
- name: create release
id: create_release
uses: actions/create-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: README.md
draft: false
prerelease: false
- name: download artifacts
uses: actions/download-artifact@v1
with:
name: ${{ github.ref_name }}
- name: upload artifacts
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: ./${{ github.ref_name }}/${{ github.ref_name }}.zip
asset_name: ${{ github.ref_name }}.zip
asset_content_type: application/zip
- name: deploy firmware
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 cp ./build/firmware.zip s3://${{ secrets.AWS_S3_MODI2_MODULE_FIRMWARE_URL }}/firmware.zip --region ap-northeast-2 --acl public-read
- name: deploy version
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 cp ./build/version.txt s3://${{ secrets.AWS_S3_MODI2_MODULE_FIRMWARE_URL }}/version.txt --region ap-northeast-2 --acl public-read
- name: deploy release notes
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 cp ./build/release_notes.md s3://${{ secrets.AWS_S3_MODI2_MODULE_FIRMWARE_URL }}/release_notes.md --region ap-northeast-2 --acl public-read