auto-publish #16
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: auto-publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CHACHA_KEY: ${{ secrets.CHACHA_KEY }} | |
CARGO_TERM_COLOR: always | |
permissions: | |
contents: write | |
on: | |
workflow_dispatch: | |
inputs: | |
addr: | |
description: addr | |
required: true | |
type: string | |
default: "0" | |
core: | |
description: core | |
required: true | |
type: number | |
default: 0 | |
jobs: | |
cli: | |
runs-on: "ubuntu-latest" | |
outputs: | |
value: ${{ steps.post.outputs.value }} | |
ref: ${{ steps.post.outputs.ref }} | |
runtime: ${{ steps.post.outputs.runtime }} | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
- | |
run: | | |
sudo apt-get -qq install chromium-driver tmux | |
shell: bash | |
name: Install Chrome | |
- | |
run: | | |
curl -fsSL https://sh.rustup.rs | bash -s -- -y | |
source ~/.bashrc | |
shell: bash | |
name: Install Rust | |
- | |
id: post | |
run: | | |
tmux new-session -d -s chromedriver | |
tmux send-keys -t chromedriver 'chromedriver --port=9515' Enter | |
cargo build --release | |
{ | |
./target/release/cli post ${{ inputs.addr }} ${{ inputs.core }} | |
} >> $GITHUB_OUTPUT | |
shell: bash | |
name: Build and Run cli | |
publish: | |
needs: | |
- cli | |
uses: ./.github/workflows/bot.yml | |
with: | |
key: ${{ needs.cli.outputs.value }} | |
value: ${{ needs.cli.outputs.ref }} |