Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

delete branches with empty merge #77

delete branches with empty merge

delete branches with empty merge #77

Workflow file for this run

name: ci
on:
push:
pull_request:
permissions:
contents: write
env:
CONAN_SYSREQUIRES_MODE: enabled
PYTHONUNBUFFERED: 1
jobs:
ci-frontend:
runs-on: ubuntu-22.04
steps:
- name: Setup npm
uses: actions/setup-node@v3
with:
node-version: "16"
- name: Checkout
uses: actions/checkout@v3
- name: Build static site
run: |
cd ccb-frontend
npm install
npm run build
- name: Deploy site
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: ccb-frontend/dist
clean: true
ci:
runs-on: ubuntu-20.04
steps:
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
run: |
echo "timestamp=$(date +%Y-%m-%d-%H-%M-%S)" >> $GITHUB_OUTPUT
- name: Configure ccache cache files
uses: actions/cache@v3
with:
path: ~/.ccache
key: ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
ccache-
- name: Install and configure ccache
run: |
sudo apt-get install ccache
ccache --version
ccache -s
echo "/usr/lib/ccache" >> $GITHUB_PATH
- name: Install and configure conan
run: |
python3 -m pip install "conan<2"
conan config install https://github.com/conan-io/hooks.git -sf hooks -tf hooks
conan config set hooks.conan-center
conan profile new default --detect
conan profile update settings.compiler.libcxx=libstdc++11 default
conan profile update conf.tools.system.package_manager:mode=install default
conan profile update conf.tools.system.package_manager:sudo=True default
conan profile show default
- name: Checkout
uses: actions/checkout@v3
- name: Edit version for release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: |
CCB_VERSION=${GITHUB_REF:10}
echo "Version: $CCB_VERSION"
sed -i "s/\"0.0.0\"/\"$CCB_VERSION\"/" ccb/_version.py
- name: Install CCB locally
run: python3 -m pip install .
- name: Pylint
run: |
python3 -m pip install pylint
pylint ccb
- name: Clone CCI
run: |
git clone https://${{ github.repository_owner }}:${{ secrets.issue_github_token }}@github.com/${{ github.repository_owner }}/conan-center-index.git
cd conan-center-index
git remote add upstream https://github.com/conan-io/conan-center-index.git
git fetch upstream
git checkout upstream/master
git config --global user.email "[email protected]"
git config --global user.name "Quentin Chateau via Conan Center Bot"

Check failure on line 107 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

You have an error in your yaml syntax on line 107
- name: Clean branches
run: |
git ls-remote --heads origin | cut -f 2 | grep refs/heads/ccb- | while read -r git_ref ; do
branch_name=${git_ref:11}
echo "::group::$branch_name"
wait
if ! git merge --no-ff --no-commit origin/$branch_name ; then
echo "::warning ::branch $branch_name has conflict with master"
elif git diff --cached --quiet ; then
echo "::warning ::branch $branch_name has no change from master, deleting it"
git push origin --delete $branch_name
fi
git merge --abort
echo "::endgroup::"
done
wait
working-directory: conan-center-index
- name: Update recipes
run: |
mkdir status
conan-center-bot auto-update-recipes \
--cci conan-center-index \
--github-token "${{ secrets.issue_github_token }}" \
--push-to origin \
--branch-prefix dev/ccb-
> ./status/v1-update.json
cat ./status/v1-update.json
- name: Update dev issue
run: |
conan-center-bot update-status-issue \
--no-link-pr \
--github-token "${{ secrets.issue_github_token }}" \
./status/v1-update.json \
https://github.com/${{ github.repository }}/issues/4
- name: Package
run: python3 setup.py sdist
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: status
folder: status
target-folder: dev
clean: false
- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}