-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (68 loc) · 3.02 KB
/
flow.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
name: Generate Font and Publish
on:
workflow_dispatch:
schedule:
# Every 1st and 15st of each month. Basically the library update itself every 15 days
- cron: "0 0 1,15 * *"
# Underscore key identifiers (some_identifier) -> Custom identifier defined within some script or the job itself (that is, is not part of GitHub action syntax)
# Dash key identifiers (some-identifier) -> Required by GitHub action, it's not defined by us
jobs:
check_if_there_is_a_new_release_update_available:
name: Check if there's a new release update available
runs-on: ubuntu-latest
outputs:
# 'update_available' came from 'has_new_release.dart' script
update_available: ${{ steps.there_is_a_new_update_available.outputs.update_available }}
steps:
- uses: actions/checkout@v2
- uses: dart-lang/setup-dart@v1
- name: Get dependencies
run: cd autoupdate && dart pub get && cd ..
- name: Check if there's a new update
id: "there_is_a_new_update_available"
run: dart run autoupdate/lib/has_new_release.dart
publish_new_release:
name: Publish new package release
needs: ["check_if_there_is_a_new_release_update_available"]
if: ${{ needs.check_if_there_is_a_new_release_update_available.outputs.update_available == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dart-lang/setup-dart@v1
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Get dependencies
run: cd autoupdate && dart pub get && cd ..
- name: Update pubspec.yaml [version] and [pixelarticons_version]
run: dart run autoupdate/lib/update.dart
- name: Generate commit message
id: commit_msg
run: dart run autoupdate/lib/commit_msg.dart
# Add, commit and push changes of the previous step (Update pubspec.yaml...)
- uses: EndBug/add-and-commit@v9 # You can change this to use a specific version.
with:
message: ${{ steps.commit_msg.outputs.new_release_commit_msg }}
- name: Install requests python library
run: pip install requests
- name: Download latest release
run: python3 download/download.py
- name: Install fontify library
run: dart pub global activate fontify
- name: Run fontify to generate the icons font (.ttf)
run: dart pub global run fontify
- name: Create credentials file
run: echo $PUB_CREDENTIALS > ~/pub-credentials.json
env:
PUB_CREDENTIALS: ${{ secrets.PUB_CREDENTIALS }}
- name: Add credentials to Dart folder
run: |
mkdir -p ${XDG_CONFIG_HOME:-${HOME:-default}}/dart
touch ${XDG_CONFIG_HOME:-${HOME:-default}}/dart/pub-credentials.json
cp ~/pub-credentials.json ${XDG_CONFIG_HOME:-${HOME:-default}}/dart/pub-credentials.json
env:
PUB_CREDENTIALS: ${{ secrets.PUB_CREDENTIALS }}
- name: Format generated files
run: dart format .
- name: Publish
run: dart pub publish --force