Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Build and Deploy

on:
push:
branches-ignore:
- 'build-**'
pull_request:
branches-ignore:
- 'build-**'

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write # Required for creating releases and pushing tags

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python 3.6
uses: actions/setup-python@v5
with:
python-version: '3.6'
cache: 'pip'

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y maven
pip install PyGithub

- name: Cache TeX Live
uses: actions/cache@v4
with:
path: |
/tmp/texlive
~/.texlive
key: texlive-${{ runner.os }}

- name: Install TeX Live
run: source ./support/texlive_install.sh

- name: Decrypt GPG key
if: github.event_name == 'push'
env:
encrypted_125c18bb9738_key: ${{ secrets.ENCRYPTED_125C18BB9738_KEY }}
encrypted_125c18bb9738_iv: ${{ secrets.ENCRYPTED_125C18BB9738_IV }}
run: |
openssl aes-256-cbc -K $encrypted_125c18bb9738_key -iv $encrypted_125c18bb9738_iv \
-in bibbot.asc.enc -out bibbot.asc -d

- name: Compile
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: source ./support/compile.sh

- name: Create Git Tag and Deploy Info
if: success() && github.event_name == 'push'
id: tag_info
run: |
export GIT_TAG=build-${{ github.ref_name }}-$(date -u "+%Y-%m-%d")-${{ github.run_number }}
echo "tag_name=$GIT_TAG" >> $GITHUB_OUTPUT
git tag $GIT_TAG -a -m "Generated tag from GitHub Actions build ${{ github.run_number }}"

- name: Deploy to GitHub Releases
if: success() && github.event_name == 'push' && github.repository == 'gipplab/bib'
uses: softprops/action-gh-release@v2
with:
files: |
main.pdf
gipp.bib
docs/publist.html
docs/pubDFG.html
tag_name: ${{ steps.tag_info.outputs.tag_name }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# bib [![Build Status](https://travis-ci.com/ag-gipp/bib.svg?branch=master)](https://travis-ci.com/ag-gipp/bib)
# bib ![Build Status](https://github.com/gipplab/bib/actions/workflows/build.yml/badge.svg)
This repo contains publications from ag-gipp.
Biblography

Expand All @@ -13,12 +13,11 @@ compare the contents of both files and overwrite `gipp.bib` with
`gipp_bibertool.bib`.

## Automatic release configuration
See the [travis manual](https://docs.travis-ci.com/user/deployment/releases/) to understand the release section of the [travis config](.travis.yml)
See the [GitHub Actions documentation](https://docs.github.com/en/actions/deployment/releasing/releasing-automatically-with-github-actions) to understand the release section of the [GitHub Actions workflow](.github/workflows/build.yml)

For the interaction with GitHub independently from travis, we create
a [personal access token](https://github.com/settings/tokens) and make
it available as environment variable
```bash
travis encrypt GITHUB_TOKEN=<paste PAT> --add
```
The GITHUB_TOKEN is automatically provided by GitHub Actions and does not need manual configuration.

For GPG-signed commits, the following repository secrets need to be added:
- `ENCRYPTED_125C18BB9738_KEY` - Encryption key for the GPG key
- `ENCRYPTED_125C18BB9738_IV` - Initialization vector for the GPG key

14 changes: 10 additions & 4 deletions support/commitPub.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#!/usr/bin/env bash
echo "Travis: $TRAVIS, CI: $CI Travis build ID $TRAVIS_BUILD_ID"
[ -z "$TRAVIS" ] && exit 1 || echo "skip commit. Travis environment variable not set."
echo "CI: $CI, GitHub Actions: $GITHUB_ACTIONS, Run ID: $GITHUB_RUN_ID"
# Support both Travis and GitHub Actions
if [ -z "$TRAVIS" ] && [ -z "$GITHUB_ACTIONS" ]; then
echo "skip commit. CI environment variable not set."
exit 1
fi
gpg --import bibbot.asc
git config --global user.email "bibbot@ckurs.de"
git config --global user.name "BibBot"
git config --global user.signingkey "1617C27854592471"
git commit -S -m "Update publication list" docs/publist.html
git remote add http https://${GITHUB_TOKEN}@github.com/ag-gipp/bib.git
git push http HEAD:$TRAVIS_BRANCH
# Use GitHub Actions branch reference if available, otherwise use Travis
BRANCH=${GITHUB_REF_NAME:-$TRAVIS_BRANCH}
git remote add http https://${GITHUB_TOKEN}@github.com/gipplab/bib.git
git push http HEAD:$BRANCH
exit 1
14 changes: 10 additions & 4 deletions support/commitPubDfg.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#!/usr/bin/env bash
echo "Travis: $TRAVIS, CI: $CI Travis build ID $TRAVIS_BUILD_ID"
[ -z "$TRAVIS" ] && exit 1 || echo "skip commit. Travis environment variable not set."
echo "CI: $CI, GitHub Actions: $GITHUB_ACTIONS, Run ID: $GITHUB_RUN_ID"
# Support both Travis and GitHub Actions
if [ -z "$TRAVIS" ] && [ -z "$GITHUB_ACTIONS" ]; then
echo "skip commit. CI environment variable not set."
exit 1
fi
gpg --import bibbot.asc
git config --global user.email "bibbot@ckurs.de"
git config --global user.name "BibBot"
git config --global user.signingkey "1617C27854592471"
git commit -S -m "Update publication list" docs/pubDFG.html
git remote add http https://${GITHUB_TOKEN}@github.com/ag-gipp/bib.git
git push http HEAD:$TRAVIS_BRANCH
# Use GitHub Actions branch reference if available, otherwise use Travis
BRANCH=${GITHUB_REF_NAME:-$TRAVIS_BRANCH}
git remote add http https://${GITHUB_TOKEN}@github.com/gipplab/bib.git
git push http HEAD:$BRANCH
exit 1
14 changes: 10 additions & 4 deletions support/commitUp.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/usr/bin/env bash
mv gipp_bibertool.bib gipp.bib
echo "Travis: $TRAVIS, CI: $CI Travis build ID $TRAVIS_BUILD_ID"
[ -z "$TRAVIS" ] && exit 1 || echo "skip commit. Travis environment variable not set."
echo "CI: $CI, GitHub Actions: $GITHUB_ACTIONS, Run ID: $GITHUB_RUN_ID"
# Support both Travis and GitHub Actions
if [ -z "$TRAVIS" ] && [ -z "$GITHUB_ACTIONS" ]; then
echo "skip commit. CI environment variable not set."
exit 1
fi
gpg --import bibbot.asc
git config --global user.email "bibbot@ckurs.de"
git config --global user.name "BibBot"
git config --global user.signingkey "1617C27854592471"
git commit -S -m "Reformat bib file" gipp.bib
git remote add http https://${GITHUB_TOKEN}@github.com/ag-gipp/bib.git
git push http HEAD:$TRAVIS_BRANCH
# Use GitHub Actions branch reference if available, otherwise use Travis
BRANCH=${GITHUB_REF_NAME:-$TRAVIS_BRANCH}
git remote add http https://${GITHUB_TOKEN}@github.com/gipplab/bib.git
git push http HEAD:$BRANCH
exit 1