github.com/mysteriumnetwork/node@v0.0.0-20240516044423-365054f76801/bin/release_ppa (about)

     1  #!/bin/bash
     2  
     3  ###########################################################################
     4  # Prepare debian/* files PPA
     5  #
     6  # Usage:
     7  #> bin/package_ppa version build_number distr
     8  
     9  set -e
    10  
    11  source bin/helpers/output.sh
    12  
    13  PPA=$1
    14  if [ -z "$PPA" ]; then
    15      print_error "Missing PPA repository name!"
    16      exit 1
    17  fi
    18  
    19  VERSION=$2
    20  if [ -z "$VERSION" ]; then
    21      print_error "Missing version!"
    22      exit 1
    23  fi
    24  
    25  BUILD=$3
    26  if [ -z "$BUILD" ]; then
    27      print_error "Missing build number!"
    28      exit 1
    29  fi
    30  
    31  DISTR=$4
    32  if [ -z "$DISTR" ]; then
    33      print_error "Missing distr!"
    34      exit 1
    35  fi
    36  
    37  go mod vendor
    38  
    39  DATE=`date -R`
    40  
    41  echo "myst ($VERSION+build$BUILD+$DISTR) $DISTR; urgency=medium
    42  
    43    * CI build number $BUILD
    44  
    45   -- Mysterium Team <core-services@mysterium.network>  $DATE
    46  " > debian/changelog
    47  
    48  echo '#!/usr/bin/make -f
    49  
    50  export DH_VERBOSE := 1
    51  export PATH := /usr/lib/go-1.20/bin/:$(PATH)
    52  export GOPATH := $(CURDIR)/go
    53  export BUILD_COMMIT := '$BUILD_COMMIT'
    54  export BUILD_BRANCH := '$BUILD_BRANCH'
    55  export BUILD_NUMBER := '$BUILD_NUMBER'
    56  export BUILD_VERSION := '$BUILD_VERSION'
    57  export GO111MODULE := off
    58  export GOCACHE := $(GOPATH)/.cache
    59  
    60  override_dh_auto_build:
    61  	mkdir -p $(GOPATH)/src/github.com/mysteriumnetwork/
    62  	ln -s $(CURDIR) $(GOPATH)/src/github.com/mysteriumnetwork/node
    63  	cd $(GOPATH)/src/github.com/mysteriumnetwork/node; bin/build
    64  
    65  override_dh_auto_test:
    66  
    67  %:
    68  	dh \$@
    69  ' > debian/rules; chmod +x debian/rules
    70  
    71  debuild -S -sa -us -uc -d
    72  debsign -k 09D3CD5598B65836 ../myst_${VERSION}+build${BUILD}+${DISTR}_source.changes
    73  
    74  # We have to add this configuration to enable SFTP since default FTP timeouts on Travis CI.
    75  echo "[myst-ppa]
    76  fqdn = ppa.launchpad.net
    77  method = sftp
    78  incoming = ~mysteriumnetwork/ubuntu/$PPA/
    79  login = mysteriumnetwork
    80  allow_unsigned_uploads = 0
    81  " > ~/.dput.cf
    82  ssh-keyscan ppa.launchpad.net >> ~/.ssh/known_hosts
    83  
    84  dput myst-ppa ../myst_${VERSION}+build${BUILD}+${DISTR}_source.changes