-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (42 loc) · 1.59 KB
/
prepare.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
name: Prepare
on:
workflow_dispatch:
inputs:
target_repo:
description: 'Target repository'
required: true
default: xoseperez/espurna
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- uses: actions/checkout@v4
with:
ref: builder
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py', 'setup.cfg') }}
- name: Install builder
run: |
# ref. pypa/pip#8180
# default ubuntu install does not include wheel, thus... install it right here
python -mpip install -U pip wheel
pip install .
- name: Prepare commit.txt
env:
GITHUB_TOKEN: ${{ secrets.BUILDER_TOKEN }}
run: |
# personalized token is required, since we trigger a commit on success
# and gh actions won't trigger another event when it is the default one
espurna_nightly prepare ${{ github.event.inputs.target_repo }} ${{ github.repository }}
- name: Dispatch Nightly
env:
GITHUB_TOKEN: ${{ secrets.BUILDER_TOKEN }}
run: |
# since the `nightly` branch lacks any contents besides commit.txt, workflow event won't be handled correctly
# ref. https://docs.github.com/en/actions/reference/events-that-trigger-workflows#configuring-workflow-events
espurna_nightly workflow --id nightly.yml --ref builder ${{ github.event.inputs.target_repo }} ${{ github.repository }}