-
Notifications
You must be signed in to change notification settings - Fork 1.5k
53 lines (52 loc) · 1.97 KB
/
notice_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
name: generate_notices
on:
pull_request:
paths:
- '.github/workflows/notice_generation.yml'
- '.github/actions/notices_generation**'
schedule:
# Run every day at 2am (PST) - cron uses UTC times
- cron: '0 10 * * *'
jobs:
generate_a_notice:
# Don't run on private repo.
if: github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule'
runs-on: macos-12
name: Generate NOTICES
env:
# The path of NOTICES based on the root dir of repo."
NOTICES_PATH: "CoreOnly/NOTICES"
steps:
- uses: actions/checkout@v3
- name: Get all pod names
run: |
cd "${GITHUB_WORKSPACE}/ReleaseTooling/"
swift run manifest --output-file-path ./output.txt --for-notices-generation
PODS=`cat ./output.txt`
echo "PODS=${PODS}" >> $GITHUB_ENV
echo "NOTICES_PATH=${GITHUB_WORKSPACE}/${NOTICES_PATH}" >> $GITHUB_ENV
- name: Create a local specs repo
run: |
cd "${GITHUB_WORKSPACE}/ReleaseTooling/"
swift run podspecs-tester --git-root "${GITHUB_WORKSPACE}"
- name: Create a NOTICES file
id: notices
uses: ./.github/actions/notices_generation/
with:
pods: ${{ env.PODS }}
sources: "https://github.com/firebase/SpecsTesting,https://github.com/firebase/SpecsStaging,https://cdn.cocoapods.org"
min-ios-version: "13.0"
search-local-pod-version: true
notices-path: ${{ env.NOTICES_PATH }}
- name: Create a pull request
run: |
RUN_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
gem install octokit
ruby scripts/create_pull_request.rb \
--repo-root ${GITHUB_WORKSPACE} \
--repo-token ${{ secrets.GITHUB_TOKEN }} \
--target-path ${{ env.NOTICES_PATH }} \
--pr-title "NOTICES Change" \
--pr-body "NOTICES Change is detected in [this GitHub Actions Run](${RUN_URL})." \
--commit-comment "NOTICES change."
shell: bash