forked from MobilityData/gtfs-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (63 loc) · 2.24 KB
/
notice_migration_generation.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
75
76
77
78
79
name: Update NOTICE_MIGRATION.md
on:
release:
types: [ prereleased, released ]
jobs:
update_notice_migration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: pip install -r scripts/notice-migration-generator/requirements.txt
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'zulu'
- name: Get previous release version
run: python3 scripts/notice-migration-generator/get_previous_release.py
- name: Checkout previous version
uses: actions/checkout@v3
with:
ref: ${{ env.PREVIOUS_VERSION }}
- name: Generate previous rules.json
run: ./gradlew webClientRulesJSON
- name: Upload previous rules.json
uses: actions/upload-artifact@v3
with:
name: rules-${{ env.PREVIOUS_VERSION }}
path: web/client/static/rules.json
- name: Checkout current version
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Generate current rules.json
run: ./gradlew webClientRulesJSON
- name: Upload current rules.json
uses: actions/upload-artifact@v3
with:
name: rules-${{ github.event.release.tag_name }}
path: web/client/static/rules.json
- name: Download all workflow artifacts
uses: actions/download-artifact@v3
- name: Validate download
run: ls -la rules*
- name: Run update script
run: |
echo "CHANGED_NOTICES<<EOF" >> $GITHUB_ENV
python3 scripts/notice-migration-generator/notice_migration_generator.py -r ${{ github.event.release.tag_name }} >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create PR
uses: peter-evans/create-pull-request@v5
with:
base: master
commit-message: "docs: Automated update of NOTICE_MIGRATION.md"
title: "docs: Automated update of NOTICE_MIGRATION.md"
delete-branch: true
body: ${{ env.CHANGED_NOTICES }}
add-paths: docs/*.md