-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (95 loc) · 3.27 KB
/
update-executables.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Update Executables
on:
push:
branches:
- "main"
workflow_dispatch:
jobs:
update:
strategy:
matrix:
args:
[
{ image: ubuntu-latest, os: linux },
{ image: macos-latest, os: macos },
{ image: windows-latest, os: windows },
]
runs-on: ${{ matrix.args.image }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fetch DVM config
id: dvm-config-action
uses: blendfactory/dvm-config-action@main
with:
path: ./app/.dvm/config.json
- name: Set up Dart
uses: dart-lang/setup-dart@v1
with:
sdk: ${{ steps.dvm-config-action.outputs.dart-sdk-version }}
- name: Get dependencies
run: dart pub get
shell: bash
working-directory: app
- name: Update
run: dart compile exe bin/app.dart -o ./../executables/${{ matrix.args.os }}/app.exe
working-directory: app
- name: Upload
uses: actions/upload-artifact@v4
with:
name: executables-${{ matrix.args.os }}
path: executables/${{ matrix.args.os }}/app.exe
create-pr:
needs: update
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download linux executable
uses: actions/download-artifact@v4
with:
name: executables-linux
path: executables/linux
- name: Download macos executable
uses: actions/download-artifact@v4
with:
name: executables-macos
path: executables/macos
- name: Download windows executable
uses: actions/download-artifact@v4
with:
name: executables-windows
path: executables/windows
- name: Generate a token for pr-creator
id: app-token-pr-creator
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID_BLENDFACTORY_PR_CREATOR }}
private-key: ${{ secrets.PRIVATE_KEY_BLENDFACTORY_PR_CREATOR }}
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v5
with:
token: ${{ steps.app-token-pr-creator.outputs.token }}
commit-message: "feat: Update executables"
branch: auto/update-executables
delete-branch: true
title: "Update executables"
- name: Auto Approve
if: steps.cpr.outputs.pull-request-operation == 'created'
run: gh pr review --approve "${{ steps.cpr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate a token for pr-auto-merge-enabler
id: app-token-pr-auto-merge-enabler
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID_BLENDFACTORY_PR_AUTO_MERGE_ENABLER }}
private-key: ${{ secrets.PRIVATE_KEY_BLENDFACTORY_PR_AUTO_MERGE_ENABLER }}
- name: Enable Pull Request Automerge
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: ${{ steps.app-token-pr-auto-merge-enabler.outputs.token }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
merge-method: squash