Skip to content

actions: update i3stat-git aur package automatically #38

actions: update i3stat-git aur package automatically

actions: update i3stat-git aur package automatically #38

Workflow file for this run

on:
push:
branches: [ "next" ]
pull_request:
branches: [ "master", "next" ]
env:
CARGO_TERM_COLOR: always
jobs:
verify:
name: Build & Test
runs-on: ubuntu-latest
steps:
# git checkout
- uses: actions/checkout@v3
# install just
- uses: extractions/setup-just@v1
# setup rust toolchain
# https://github.com/actions-rs/toolchain/issues/126#issuecomment-782989659
- run: rustup show
# cache
- uses: actions/cache@v3
with:
path: scripts/node/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# verify
- run: just setup
- run: just build
- run: DEBUG=1 just test
release-aur-git:
name: Update AUR(i3stat-git)
needs: ['verify']
runs-on: ubuntu-latest
# this should only run on pushes to `next`, not pull requests to it
if: github.event_name == 'push'
steps:
- uses: extractions/setup-just@v1
- name: Setup SSH
run: |
eval "$(ssh-agent)"
ssh-add - <<< "${{ secrets.AUR_SSH_KEY }}"
mkdir -p $HOME/.ssh/
echo ${{ env.SSH_KNOWN_HOSTS }} >> $HOME/.ssh/known_hosts
- run: git clone [email protected]/i3stat-git.git i3stat && cd "$_"
- run: just update
- run: git push