forked from OkBuddyGSI/gsi_builder
-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (50 loc) · 1.87 KB
/
setup-runner.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
#Needs to be run once only!
name: Needs to be run once only! Running again leads to reset
on:
workflow_dispatch:
inputs:
GITHUB_REPO:
description: 'Repository'
default: 'a57y17lte-dev/lineage_builder'
required: true
RUNNER_TOKEN:
description: 'This is the runner token, not PAT'
required: true
jobs:
run-devspace-and-tmux:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up environment
run: |
sudo apt-get update
sudo apt-get install -y tmux
# Download and configure 'crave'.
- name: Configure the 'crave' environment
run: |
if [ "${DCDEVSPACE}" == "1" ]; then
echo 'No need to set up crave, we are already running in devspace!'
else
mkdir ${HOME}/bin/
curl -s https://raw.githubusercontent.com/accupara/crave/master/get_crave.sh | bash -s --
mv ${PWD}/crave ${HOME}/bin/
sudo ln -sf /home/${USER}/bin/crave /usr/bin/crave
envsubst < ${PWD}/crave.conf.sample >> ${PWD}/crave.conf
rm -rf ${PWD}/crave.conf.sample
fi
env:
CRAVE_USERNAME: ${{ secrets.CRAVE_USERNAME }}
CRAVE_TOKEN: ${{ secrets.CRAVE_TOKEN }}
- name: Run crave devspace
run: |
crave devspace -- "rm -rf y17ltebuilds ~/actions-runner || true
curl https://raw.githubusercontent.com/sounddrill31/Install-GithubActions-Runner/a57y17lte-dev/fetch-latest-zip.sh | bash
cd y17ltebuilds
if [[ "${{ inputs.RUNNER_TOKEN }}" == "github_pat_*" ]]; then
echo "PAT does not work!"
else
echo "Runner token found"
fi
cd y17ltebuilds
./config.sh --unattended --url "https://github.com/${{ inputs.GITHUB_REPO }}" --token "${{ inputs.RUNNER_TOKEN }}""