DumprX Using Crave #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: DumprX Using Crave | |
on: | |
workflow_dispatch: | |
inputs: | |
ROM_URL: | |
description: "Direct Link of the ROM/Firmware to Dump" | |
required: true | |
EXTRA_CMD: | |
description: "Any Extra Command to Run Before Dump" | |
required: false | |
defaults: | |
run: | |
shell: bash | |
env: | |
# ROM | |
ROM_URL: ${{ github.event.inputs.ROM_URL }} | |
# Gitlab | |
PUSH_TO_GITLAB: true | |
# Extra Command | |
EXTRA_CMD: ${{ github.event.inputs.EXTRA_CMD }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkouts | |
uses: actions/checkout@v2 | |
- name: Configure the 'crave' environment | |
run: | | |
if [ "${DCDEVSPACE}" == "1" ]; then | |
echo 'No need to set up crave, we are already running in devspace!' | |
else | |
curl -s https://raw.githubusercontent.com/accupara/crave/master/get_crave.sh | bash -s -- | |
mkdir ${HOME}/bin/ | |
mv ${PWD}/crave ${HOME}/bin/ | |
sudo ln -sf /home/${USER}/bin/crave /usr/bin/crave | |
envsubst < crave.yaml.sample > crave.yaml | |
rm -rf crave.conf.sample | |
fi | |
env: | |
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }} | |
GITLAB_GROUP: ${{ secrets.GITLAB_GROUP }} | |
PRIV_SSH_KEY: ${{ secrets.PRIV_SSH_KEY }} | |
BOT_TOKEN: ${{ secrets.BOT_TOKEN }} | |
CHAT_ID: ${{ secrets.CHAT_ID }} | |
- name: Extract using Crave | |
run: | | |
crave -v run --projectID=77 -c crave.yaml -- "sudo bash setup.sh | |
sudo apt install -y f2fs-tools | |
mkdir -p ~/.ssh | |
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts | |
ssh-keyscan -t rsa gitlab.com >> ~/.ssh/known_hosts | |
git config --global user.name "${{ github.actor }}" | |
git config --global user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" | |
echo "$GITLAB_TOKEN" > .gitlab_token; \ | |
echo "$GITLAB_GROUP" > .gitlab_group; \ | |
echo "$PRIV_SSH_KEY" > ~/.ssh/id_rsa; \ | |
echo "$BOT_TOKEN" > .tg_token; \ | |
echo "$CHAT_ID" > .tg_chat; \ | |
chmod 600 ~/.ssh/id_rsa | |
$EXTRA_CMD | |
./dumper.sh "$ROM_URL"" |