forked from sylabs/singularity
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (52 loc) · 1.79 KB
/
update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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