Changes the repo to be passed as argument

This commit is contained in:
Thiago Silva 2022-05-16 13:31:00 -03:00
commit a437e12afd
No known key found for this signature in database
GPG key ID: 034303EB8F453169
3 changed files with 11 additions and 6 deletions

View file

@ -70,9 +70,10 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 90
steps:
- name: Checkout the Tag
- name: Sets the tag and repo variables (to build)
run: |
echo "TAG=${{ github.event.inputs.ref }}" >> $GITHUB_ENV
echo "REPO_TO_BUILD=${{ github.event.inputs.repo }}" >> $GITHUB_ENV
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
submodules: "recursive"
@ -84,7 +85,8 @@ jobs:
run: |
mkdir -p ${GITHUB_WORKSPACE}/artifacts
docker run -e LIVE=1 -e PAT=${{ secrets.GITHUB_TOKEN }} \
-e TAG=$TAG -v ${GITHUB_WORKSPACE}:/workspace \
-e TAG=$TAG -e REPO_TO_BUILD=$REPO_TO_BUILD
-v ${GITHUB_WORKSPACE}:/workspace \
-v ${GITHUB_WORKSPACE}/artifacts:/root/rpmbuild \
nanocurrency/nano-env:centos /bin/bash -c "ci/build-centos.sh"
- name: Deploy Artifacts

View file

@ -2,9 +2,10 @@
TAG=$(echo $TAG)
VERSIONS=${TAG//V/}
RELEASE=$(echo $CI_JOB_ID)
REPO_TO_BUILD=$(echo $REPO_TO_BUILD)
run_source() {
./util/makesrc $TAG $(echo $PAT)
./util/makesrc $TAG $(echo $PAT) $REPO_TO_BUILD
}
run_build() {

View file

@ -4,21 +4,23 @@
# personal access token allows around rate limit
if [ -e $2 ]; then
echo "makesrc <tag> <pat>" >&2
echo " tag valid <tag> for nanocurrency/nano-node" >&2
echo "makesrc <tag> <pat> <repo>" >&2
echo " tag valid <tag> for <repo>" >&2
echo " pat personal access token" >&2
echo " repo repository to build" >&2
exit 1
fi
TAG="$1"
PAT="$2"
repository="${3:-nanocurrency/nano-node}"
VERSION=$(echo $TAG | sed 's/V//')
TAG_DATE=""
VERSION_MAJOR=$(echo $VERSION | cut -d "." -f 1)
scriptDir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
function make_source() {
git clone --recursive --single-branch --branch ${TAG} https://github.com/nanocurrency/nano-node nano-$VERSION
git clone --recursive --single-branch --branch "${TAG}" "https://github.com/${repository}" "nano-${VERSION}"
cd nano-$VERSION
git fetch --tags
COUNT=$(git tag -l "${TAG}" | wc -l)