Skip to content

Update from upstream #2722

Update from upstream

Update from upstream #2722

Workflow file for this run

name: Update from upstream
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
inputs:
force_release:
description: 'Force creating the release branch'
required: false
type: boolean
default: false
push:
branches:
- cras
jobs:
update-upstream:
runs-on: ubuntu-latest
container: golang:latest
steps:
- uses: actions/checkout@master
- name: update
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPSTREAM: https://github.com/sylabs/singularity
run: |
USER_INPUT=${{ inputs.force_release }}
FORCE_RELEASE=${USER_INPUT:-false}
echo "MIRRORSITE=http://archive.ubuntu.com/ubuntu/" > /etc/pbuilderrc
apt-get -qq -y update
apt-get -qq -y install bash git python3 devscripts git-buildpackage
rm -rf singularity
git clone https://x-access-token:${GITHUB_TOKEN}@github.com/ctu-vras/singularity.git
cd singularity
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git checkout main
git remote add upstream "${UPSTREAM}"
git fetch upstream --tags
git reset --hard upstream/main
git push --force origin main --tags
git fetch origin
git checkout cras
git merge main --no-edit
echo "FORCE_RELEASE=${FORCE_RELEASE}"
[ "${FORCE_RELEASE}" != "true" ] && [ "$(git rev-parse cras)" = "$(git rev-parse origin/cras)" ] && exit 0
git push origin cras
git checkout debian-release
git reset --hard cras
git submodule update --init
PATH=/usr/local/go/bin:$PATH debian/prepare.sh
git commit -m "Upstream release $(cat VERSION)"
git push --force origin debian-release