-
Notifications
You must be signed in to change notification settings - Fork 16
77 lines (67 loc) · 2.34 KB
/
pio-release.yaml
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
on:
push:
tags:
- 'v*'
name: Create Release
jobs:
version:
runs-on: ubuntu-latest
steps:
- id: get_version
uses: battila7/get-version-action@v2
outputs:
major: ${{ steps.get_version.outputs.major }}
minor: ${{ steps.get_version.outputs.minor }}
patch: ${{ steps.get_version.outputs.patch }}
prerelease: ${{ steps.get_version.outputs.prerelease }}
build:
needs: version
uses: ./.github/workflows/pio-build.yaml
with:
major: ${{ needs.version.outputs.major }}
minor: ${{ needs.version.outputs.minor }}
patch: ${{ needs.version.outputs.patch }}
prerelease: ${{ needs.version.outputs.prerelease }}
secrets: inherit
release:
permissions: write-all
needs: build
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Get current tag
id: tag
run: echo "tag=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
id: download
with:
name: ${{ needs.build.outputs.artifact }}
path: dist
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
draft: false
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Zip artifacts
run: zip -j ${{ steps.tag.outputs.tag }}-dist.zip ./dist/*
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: ${{ steps.tag.outputs.tag }}-dist.zip
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-2
- name: Upload files to S3
run: |
aws s3 cp ./dist/firmware.debug.signed.bin s3://smartevse-3/${{ github.repository_owner }}_sensorboxv2_firmware.debug.signed.bin
aws s3 cp ./dist/firmware.signed.bin s3://smartevse-3/${{ github.repository_owner }}_sensorboxv2_firmware.signed.bin