-
Notifications
You must be signed in to change notification settings - Fork 868
70 lines (63 loc) · 2.11 KB
/
release.yml
File metadata and controls
70 lines (63 loc) · 2.11 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
name: Release
on:
release:
types: [published]
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
version-tag: ${{ steps.extract-tag.outputs.version }}
release-id: ${{ steps.extract-release.outputs.id }}
upload-url: ${{ steps.extract-release.outputs.upload_url }}
steps:
- name: Extract version tag
id: extract-tag
run: |
VERSION_TAG=${GITHUB_REF#refs/tags/}
echo "version=${VERSION_TAG}" >> $GITHUB_OUTPUT
echo "Extracted version: ${VERSION_TAG}"
- name: Extract release info
id: extract-release
run: |
RELEASE_ID=$(jq --raw-output '.release.id' $GITHUB_EVENT_PATH)
UPLOAD_URL="https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets{?name,label}"
echo "id=${RELEASE_ID}" >> $GITHUB_OUTPUT
echo "upload_url=${UPLOAD_URL}" >> $GITHUB_OUTPUT
echo "Release ID: ${RELEASE_ID}"
build:
needs: prepare
name: Build release firmware
uses: ./.github/workflows/task-build.yml
with:
enable-dev-ota: false
version-tag: ${{ needs.prepare.outputs.version-tag }}
artifact-retention-days: 90
deploy:
needs: [prepare, build]
runs-on: ubuntu-latest
name: Deploy release assets
steps:
- name: Download all firmware artifacts
uses: actions/download-artifact@v4
with:
pattern: "*"
path: generated/artifacts
merge-multiple: true
- name: Upload Release Assets
uses: bgpat/release-asset-action@03b0c30db1c4031ce3474740b0e4275cd7e126a3
with:
pattern: "generated/artifacts/*"
github-token: ${{ secrets.GITHUB_TOKEN }}
release-url: ${{ needs.prepare.outputs.upload-url }}
allow-overwrite: true
documentation:
needs: [prepare, deploy]
name: Build and deploy release documentation
uses: ./.github/workflows/task-docs.yml
with:
mode: "prod"
version: ${{ needs.prepare.outputs.version-tag }}
url-prefix: "/"
destination-dir: "."
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}