-
Notifications
You must be signed in to change notification settings - Fork 37
74 lines (64 loc) · 2.04 KB
/
ci.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
name: Build Firmware
on:
push:
tags:
- '*'
pull_request_target:
branches:
- main
- develop
types: [opened, reopened, synchronize]
jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/bird-sanctuary/bluejay-builder
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- name: Code Checkout
uses: actions/checkout@v3
- name: Cache Toolchain
id: cache-toolchain
uses: actions/cache@v3
with:
path: ~/.wine
key: toolchain-cache
- name: Prepare build environment
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
env:
BUILD_ENV_URL: ${{ secrets.BUILD_ENV_URL }}
BUILD_ENV_PASSWORD: ${{ secrets.BUILD_ENV_PASSWORD }}
run: |
rm -rf ~/.wine
wget -c "$BUILD_ENV_URL" -O wine.zip
unzip -P "$BUILD_ENV_PASSWORD" wine.zip -d ~/
- name: Build
run: |
make all
mv build/hex "bluejay-${GITHUB_RUN_NUMBER}"
- name: Bundle Artifacts
run: tar -cvzf bluejay-${{ github.run_number }}.tar.gz "bluejay-${GITHUB_RUN_NUMBER}"
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: bluejay-ci-${{ github.run_number }}
path: bluejay-${{ github.run_number }}.tar.gz
retention-days: 30
- name: Generate Changelog
if: startsWith(github.ref, 'refs/tags/v')
id: github_release
uses: mikepenz/release-changelog-builder-action@v3
with:
configuration: ".changelog-configuration.json"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
if: startsWith(github.ref, 'refs/tags/v')
uses: stylesuxx/[email protected]
with:
body: ${{steps.github_release.outputs.changelog}}
files: ./bluejay-${{ github.run_number }}/*.hex
token: ${{ secrets.ACCESS_TOKEN }}
prerelease: true