Converting travis page builder to GitHub Actions.
Signed-off-by: Tim 'mithro' Ansell <tansell@google.com>
This commit is contained in:
parent
44c0c4ce35
commit
c7309c692f
|
|
@ -43,7 +43,16 @@ fi
|
||||||
# Output some information about the version of Project X-ray we are using.
|
# Output some information about the version of Project X-ray we are using.
|
||||||
(
|
(
|
||||||
cd $TMPDIR/prjxray
|
cd $TMPDIR/prjxray
|
||||||
|
# Add upstream if it doesn't exist
|
||||||
|
if git remote -v | grep -q SymbiFlow/prjxray; then
|
||||||
|
echo "Upstream repo already exists."
|
||||||
|
else
|
||||||
|
git remote add upstream https://github.com/SymbiFlow/prjxray.git
|
||||||
|
git fetch upstream
|
||||||
|
fi
|
||||||
|
# Make sure we have tags
|
||||||
git fetch --tags
|
git fetch --tags
|
||||||
|
# Reset to the right revision
|
||||||
git reset --hard $PRJXRAY_INFO_REVISION
|
git reset --hard $PRJXRAY_INFO_REVISION
|
||||||
echo
|
echo
|
||||||
echo "Project X-Ray Revision $(git describe --long --tags --always)"
|
echo "Project X-Ray Revision $(git describe --long --tags --always)"
|
||||||
|
|
@ -60,9 +69,11 @@ fi
|
||||||
)
|
)
|
||||||
|
|
||||||
# Generate the HTML for each device we have a settings file for.
|
# Generate the HTML for each device we have a settings file for.
|
||||||
for SETTINGS in $TMPDIR/prjxray/settings/*.sh; do
|
for SETTINGS in $(ls $TMPDIR/prjxray/settings/*.sh | grep '7.sh$'); do
|
||||||
DEVICE="$(basename $SETTINGS .sh)"
|
DEVICE="$(basename $SETTINGS .sh)"
|
||||||
|
|
||||||
|
export PYTHONPATH=$PYTHONPATH:$TMPDIR/prjxray
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Generating for $DEVICE"
|
echo "Generating for $DEVICE"
|
||||||
echo "--------------------------------------------"
|
echo "--------------------------------------------"
|
||||||
|
|
@ -95,7 +106,7 @@ for SETTINGS in $TMPDIR/prjxray/settings/*.sh; do
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
cp COPYING html/COPYING
|
cp LICENSE html/LICENSE
|
||||||
|
|
||||||
# Generate the index page from the Info.md file
|
# Generate the index page from the Info.md file
|
||||||
python3 -m markdown \
|
python3 -m markdown \
|
||||||
|
|
@ -7,6 +7,9 @@ if [ ! -d html ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export GIT_COMMITTER_NAME="SymbiFlow Travis Bot"
|
||||||
|
export GIT_COMMITTER_EMAIL="nobody@nowhere.com"
|
||||||
|
|
||||||
export GIT_AUTHOR_NAME="$(git log -1 --pretty=%an)"
|
export GIT_AUTHOR_NAME="$(git log -1 --pretty=%an)"
|
||||||
export GIT_AUTHOR_EMAIL="$(git log -1 --pretty=%ae)"
|
export GIT_AUTHOR_EMAIL="$(git log -1 --pretty=%ae)"
|
||||||
|
|
||||||
|
|
@ -54,12 +57,12 @@ TMPDIR=$(mktemp -d)
|
||||||
git status
|
git status
|
||||||
echo "--------------------------------------------"
|
echo "--------------------------------------------"
|
||||||
|
|
||||||
if [ ! -z "$TRAVIS" ]; then
|
if [ ! -z "$GITHUB_WORKFLOW" ]; then
|
||||||
git commit -a \
|
git commit -a \
|
||||||
-m "Travis build #$TRAVIS_BUILD_NUMBER of $CURRENT_REVISION" \
|
-m "GitHub Actions build #$GITHUB_RUN_NUMBER of $CURRENT_REVISION" \
|
||||||
-m "" \
|
-m "" \
|
||||||
-m "From https://github.com/$TRAVIS_REPO_SLUG/tree/$TRAVIS_COMMIT" \
|
-m "From https://github.com/$GITHUB_REPOSITORY/tree/$GITHUB_SHA" \
|
||||||
-m "$TRAVIS_COMIT_MESSAGE"
|
-m "$CURRENT_MESSAGE"
|
||||||
else
|
else
|
||||||
git commit -a \
|
git commit -a \
|
||||||
-m "Manual build of $CURRENT_REVISION" \
|
-m "Manual build of $CURRENT_REVISION" \
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
markdown
|
markdown
|
||||||
pygments
|
pygments
|
||||||
|
pyyaml
|
||||||
|
|
@ -2,16 +2,12 @@
|
||||||
set -e
|
set -e
|
||||||
set +x
|
set +x
|
||||||
|
|
||||||
if [ ! -z "$TRAVIS_BRANCH" -a "$TRAVIS_BRANCH" != "master" ]; then
|
|
||||||
echo "On $TRAVIS_BRANCH, not saving key."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -z "$GH_KEY" ]; then
|
if [ ! -z "$GH_KEY" ]; then
|
||||||
|
mkdir -p ~/.ssh
|
||||||
ssh-agent > ~/.ssh/agent.sh
|
ssh-agent > ~/.ssh/agent.sh
|
||||||
. ~/.ssh/agent.sh
|
. ~/.ssh/agent.sh
|
||||||
mkdir -p ~/.ssh/
|
mkdir -p ~/.ssh/
|
||||||
echo "$GH_KEY" | base64 -d > ~/.ssh/id_git
|
echo "$GH_KEY" > ~/.ssh/id_git
|
||||||
chmod 0400 ~/.ssh/id_git
|
chmod 0400 ~/.ssh/id_git
|
||||||
ssh-keygen -y -f ~/.ssh/id_git > ~/.ssh/id_git.pub
|
ssh-keygen -y -f ~/.ssh/id_git > ~/.ssh/id_git.pub
|
||||||
ssh-add ~/.ssh/id_git
|
ssh-add ~/.ssh/id_git
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
name: Build GitHub Pages
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
#env:
|
||||||
|
# global:
|
||||||
|
# - GIT_COMMITTER_NAME="SymbiYosys Travis Bot"
|
||||||
|
# - GIT_COMMITTER_EMAIL="nobody@nowhere.com"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
Build-GitHub-Pages:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Save SSH key
|
||||||
|
run: ./.github/scripts/save-key.sh
|
||||||
|
env:
|
||||||
|
GH_KEY: ${{ secrets.GH_KEY }}
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: '3.x'
|
||||||
|
cache: 'pip'
|
||||||
|
|
||||||
|
- name: Install Python Dependencies
|
||||||
|
run: pip install -r ./.github/scripts/requirements.txt
|
||||||
|
|
||||||
|
- name: Generate HTML pages
|
||||||
|
run: ./.github/scripts/generate-html.sh
|
||||||
|
|
||||||
|
- name: Push to gh-pages branch
|
||||||
|
run: if [ -e ~/.ssh/agent.sh ]; then source ~/.ssh/agent.sh; ./.github/scripts/push-html.sh; fi
|
||||||
21
.travis.yml
21
.travis.yml
|
|
@ -1,21 +0,0 @@
|
||||||
language: python
|
|
||||||
python:
|
|
||||||
- "3.6"
|
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- GIT_COMMITTER_NAME="SymbiYosys Travis Bot"
|
|
||||||
- GIT_COMMITTER_EMAIL="nobody@nowhere.com"
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- ./.travis/save-key.sh
|
|
||||||
- ./.travis/fix-git.sh
|
|
||||||
|
|
||||||
install:
|
|
||||||
- pip install -r ./.travis/requirements.txt
|
|
||||||
|
|
||||||
script:
|
|
||||||
- ./.travis/generate-html.sh
|
|
||||||
|
|
||||||
after_success:
|
|
||||||
- if [ -e ~/.ssh/agent.sh ]; then source ~/.ssh/agent.sh; ./.travis/push-html.sh; fi
|
|
||||||
Loading…
Reference in New Issue