github.com/status-im/status-go@v1.1.0/_assets/ci/Jenkinsfile.ios (about)

     1  #!/usr/bin/env groovy
     2  library 'status-jenkins-lib@v1.9.6'
     3  
     4  pipeline {
     5    agent { label 'macos && aarch64 && xcode-15.1 && nix-2.19' }
     6  
     7    parameters {
     8      string(
     9        name: 'BRANCH',
    10        defaultValue: 'develop',
    11        description: 'Name of branch to build.'
    12      )
    13      booleanParam(
    14        name: 'RELEASE',
    15        defaultValue: false,
    16        description: 'Enable to create build for release.',
    17      )
    18    }
    19  
    20    options {
    21      timestamps()
    22      ansiColor('xterm')
    23      /* Prevent Jenkins jobs from running forever */
    24      timeout(time: 10, unit: 'MINUTES')
    25      disableConcurrentBuilds()
    26      /* manage how many builds we keep */
    27      buildDiscarder(logRotator(
    28        numToKeepStr: '5',
    29        daysToKeepStr: '30',
    30        artifactNumToKeepStr: '1',
    31      ))
    32    }
    33  
    34    environment {
    35      PLATFORM = 'ios'
    36      TMPDIR   = "${WORKSPACE_TMP}"
    37      GOPATH   = "${WORKSPACE_TMP}/go"
    38      GOCACHE  = "${WORKSPACE_TMP}/gocache"
    39      PATH     = "${PATH}:${GOPATH}/bin"
    40      REPO_SRC = "${GOPATH}/src/github.com/status-im/status-go"
    41      VERSION  = sh(script: "./_assets/scripts/version.sh", returnStdout: true)
    42      ARTIFACT = utils.pkgFilename(
    43        name:    'status-go',
    44        type:    env.PLATFORM,
    45        version: env.VERSION,
    46        ext:     'zip',
    47      )
    48      /* fix for gomobile complaining about missing packages */
    49      CGO_ENABLED = "1"
    50    }
    51  
    52    stages {
    53      stage('Prep') {
    54        steps { /* Go needs to find status-go in GOPATH. */
    55          sh "mkdir -p \$(dirname ${REPO_SRC})"
    56          sh "ln -s ${WORKSPACE} ${REPO_SRC}"
    57        }
    58      }
    59  
    60      stage('Compile') {
    61        steps { script {
    62          nix.shell('make statusgo-ios', pure: false, sandbox: false)
    63        } }
    64      }
    65  
    66      stage('Archive') {
    67        steps {
    68          dir('build/bin') {
    69            sh "zip -r ${WORKSPACE}/${ARTIFACT} Statusgo.xcframework"
    70          }
    71          archiveArtifacts(ARTIFACT)
    72        }
    73      }
    74  
    75      stage('Upload') {
    76        steps { script {
    77          env.PKG_URL = s3.uploadArtifact(ARTIFACT)
    78        } }
    79      }
    80    } // stages
    81    post {
    82      success { script { github.notifyPR(true) } }
    83      failure { script { github.notifyPR(false) } }
    84      cleanup { sh 'make deep-clean' }
    85    } // post
    86  } // pipeline