Skip to content

daily

daily #1307

Workflow file for this run

name: daily
on:
push:
schedule:
- cron: '6 0 * * *' # M H d m w (daily at 00:06)
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with: {python-version: '3.x'}
- name: set PYSHA
run: echo "PYSHA=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PYSHA }}|${{ hashFiles('.pre-commit-config.yaml') }}
- run: pip install -U pre-commit
- run: pre-commit run -a --show-diff-on-failure
snap-gh:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: clone source
run: |
git clone https://${GITHUB_TOKEN}@github.com/casperdcl/cli --branch snap
pushd cli
git remote add upstream https://github.com/cli/cli
git fetch upstream trunk && git fetch upstream --tags
git tag -d v9.9.9-test || :
git config user.name "Casper da Costa-Luis"
git config user.email [email protected]
git rebase upstream/trunk && git push -f && git push --tags -f
if [ -z "$(git log --since=1.day)" ]; then
echo "no change so skipping"
echo "skip=true" >> $GITHUB_ENV
else
echo "change detected so building"
echo "skip=" >> $GITHUB_ENV
fi
popd
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_GH }}
- if: '!env.skip'
id: snap_build
uses: snapcore/action-build@v1
with:
path: cli
- if: '!env.skip'
uses: snapcore/action-publish@v1
with:
store_login: ${{ secrets.SNAP_TOKEN_GH }}
snap: ${{ steps.snap_build.outputs.snap }}
release: edge