Skip to content

Change git url and git config to fix CI failure #175

Change git url and git config to fix CI failure

Change git url and git config to fix CI failure #175

Workflow file for this run

name: Build artifacts
on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master
env:
DEBIAN_FRONTEND: noninteractive
MASTER_BRANCH: refs/heads/master
VERSION_PIPENV: 2020.11.15
INDEX_BUILDER_COMMIT: 4fc61ecb09514fe285f43c7316c5c7f52c3ade6b
jobs:
build-stubs:
name: Build ros_stubs
runs-on: ubuntu-latest
container:
image: ros:noetic-ros-core
steps:
- name: Set up git and ssh
run: |
# actions/checkout@v2 requires git>=2.18, which is available in noetic-ros-core (focal)
# So we don't need to use ppa
apt-get update -y
apt-get install -y --no-install-recommends git git-lfs openssh-client
- uses: actions/checkout@v2
- name: Set up Python
run: |
apt-get install -y --no-install-recommends \
python3-pip \
python3.8 \
python3.8-dev
pip3 install pipenv==${{ env.VERSION_PIPENV }}
- name: Prepare build env
run: |
cd assets/
pipenv sync
git lfs install
- name: Set target branch if ref is tagged
if: startsWith(github.ref, 'refs/tags/')
run: |
echo DEPLOY_BRANCH=stubs >> $GITHUB_ENV
- name: Build and push artifacts
if: startsWith(github.ref, 'refs/tags/') || github.ref == env.MASTER_BRANCH
id: release
env:
GIT_SSH_COMMAND: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
ssh-agent -a ${SSH_AUTH_SOCK} > /dev/null
echo "${{ secrets.ROSPYPI_SIMPLE_DEPLOY_KEY }}" > ~/deploy_key
chmod 600 ~/deploy_key
ssh-add ~/deploy_key
cd assets/
pipenv run python publish_artifacts.py \
--url git@github.com:rospypi/simple.git \
--branch ${DEPLOY_BRANCH:-stubs_pre} --ref-branch stubs --push
- name: Build artifacts
if: steps.release.conclusion == 'skipped'
run: |
cd assets/
pipenv run python publish_artifacts.py
build-pages:
name: Build gh_pages
needs: build-stubs
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Prepare build env
run: |
python3 -m pip install --upgrade pip
pip3 install git+https://github.com/rospypi/index_builder.git@${{ env.INDEX_BUILDER_COMMIT }}
- name: Build index html
run: |
git clone https://github.com/rospypi/simple.git simple
mkdir index
python3 -m index_builder repo --path simple index
python3 -m index_builder repo --prefix pre --path simple index/_pre
- name: Push gh-pages
if: startsWith(github.ref, 'refs/tags/') || github.ref == env.MASTER_BRANCH
env:
GIT_SSH_COMMAND: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
ssh-agent -a ${SSH_AUTH_SOCK} > /dev/null
echo "${{ secrets.ROSPYPI_SIMPLE_DEPLOY_KEY }}" > ~/deploy_key
chmod 600 ~/deploy_key
ssh-add ~/deploy_key
cd index
git init
git config user.name "ros_stubs"
git config user.email "ros_stubs@noreply.github.com"
git remote add origin git@github.com:rospypi/simple.git
git checkout -b gh-pages
touch .nojekyll
git add .
git commit -am "Release $(date)"
git push -f origin gh-pages