Quellcode durchsuchen

[azure-pipelines] use neko snapshots from S3

Andy Li vor 6 Jahren
Ursprung
Commit
e475edd5b3

+ 15 - 29
azure-pipelines.yml

@@ -64,12 +64,9 @@ stages:
             lua:
               TEST: lua
         steps:
-          - script: |
-              set -ex
-              sudo add-apt-repository -y ppa:haxe/snapshots
-              sudo apt-get update -qqy
-              sudo apt-get install -qqy neko
-            displayName: Setup Neko
+          - template: extra/azure-pipelines/install-neko-snapshot.yaml
+            parameters:
+              platform: linux64
           - task: DownloadPipelineArtifact@0
             inputs:
               artifactName: 'linuxBinaries'
@@ -134,11 +131,9 @@ stages:
             lua:
               TEST: lua
         steps:
-          - script: |
-              set -ex
-              brew update
-              brew install neko --HEAD
-            displayName: Setup Neko
+          - template: extra/azure-pipelines/install-neko-snapshot.yaml
+            parameters:
+              platform: mac
           - task: DownloadPipelineArtifact@0
             inputs:
               artifactName: 'macBinaries'
@@ -202,12 +197,9 @@ stages:
             # lua:
             #   TEST: lua
         steps:
-          - powershell: |
-              Set-PSDebug -Trace 1
-              choco install neko --prerelease --ignore-dependencies -s 'https://ci.appveyor.com/nuget/neko' -y
-              Set-PSDebug -Trace 0
-              Write-Host "##vso[task.setvariable variable=NEKOPATH]C:/ProgramData/chocolatey/lib/neko"
-            displayName: Setup Neko
+          - template: extra/azure-pipelines/install-neko-snapshot.yaml
+            parameters:
+              platform: windows
           - task: DownloadPipelineArtifact@0
             inputs:
               artifactName: 'win64Binaries'
@@ -265,12 +257,9 @@ stages:
             inputs:
               artifactName: 'win32Binaries'
               targetPath: win32Binaries
-          - script: |
-              set -ex
-              sudo add-apt-repository -y ppa:haxe/snapshots
-              sudo apt-get update -qqy
-              sudo apt-get install -qqy neko
-            displayName: Setup Neko
+          - template: extra/azure-pipelines/install-neko-snapshot.yaml
+            parameters:
+              platform: linux64
           - script: |
               set -ex
               tar -xf linuxBinaries/*_bin.tar.gz -C linuxBinaries --strip-components=1
@@ -349,12 +338,9 @@ stages:
           vmImage: 'ubuntu-16.04'
         steps:
           - checkout: none
-          - script: |
-              set -ex
-              sudo add-apt-repository -y ppa:haxe/snapshots
-              sudo apt-get update -qqy
-              sudo apt-get install -qqy neko
-            displayName: Setup Neko
+          - template: extra/azure-pipelines/install-neko-snapshot.yaml
+            parameters:
+              platform: linux64
           - task: DownloadPipelineArtifact@0
             inputs:
               artifactName: 'linuxBinaries'

+ 3 - 12
extra/azure-pipelines/build-linux.yml

@@ -18,18 +18,9 @@ jobs:
           sudo apt-get update -qqy
           sudo apt-get install -qqy ocaml-nox camlp4-extra opam libpcre3-dev zlib1g-dev libgtk2.0-dev ninja-build
         displayName: Install dependencies
-      - script: |
-          set -ex
-          unset MACHINE RELEASE SYSTEM VERSION # https://marc.info/?l=gentoo-commits&m=155026142713994
-          mkdir $HOME/neko
-          pushd $HOME/neko
-          git clone --recursive https://github.com/HaxeFoundation/neko.git .
-          cmake . -DSTATIC_DEPS=all -G Ninja
-          ninja download_static_deps || ninja download_static_deps || ninja download_static_deps
-          ninja
-          sudo ninja install
-          popd
-        displayName: Install Neko
+      - template: install-neko-snapshot.yaml
+        parameters:
+          platform: linux64
       - script: |
           set -ex
           opam init

+ 3 - 11
extra/azure-pipelines/build-mac.yml

@@ -17,17 +17,9 @@ jobs:
           brew update
           brew bundle --file=tests/Brewfile --no-upgrade
         displayName: Install dependencies
-      - script: |
-          set -ex
-          mkdir $HOME/neko
-          pushd $HOME/neko
-          git clone --recursive https://github.com/HaxeFoundation/neko.git .
-          cmake . -DSTATIC_DEPS=all -G Ninja
-          ninja download_static_deps || ninja download_static_deps || ninja download_static_deps
-          ninja -j 4
-          sudo ninja install
-          popd
-        displayName: Install Neko
+      - template: install-neko-snapshot.yaml
+        parameters:
+          platform: mac
       - script: |
           set -ex
           opam init

+ 3 - 7
extra/azure-pipelines/build-windows.yml

@@ -29,13 +29,9 @@ jobs:
           choco install --no-progress nsis.portable --version 3.02 -y
           choco install --no-progress curl wget 7zip.portable -y
         displayName: Install dependencies
-      - powershell: |
-          Set-PSDebug -Trace 1
-          choco install --no-progress neko --prerelease --ignore-dependencies -s 'https://ci.appveyor.com/nuget/neko' -y
-          neko -version
-          Set-PSDebug -Trace 0
-          Write-Host "##vso[task.setvariable variable=NEKOPATH]C:/ProgramData/chocolatey/lib/neko"
-        displayName: Install Neko
+      - template: install-neko-snapshot.yaml
+        parameters:
+          platform: windows
       - powershell: |
           Set-PSDebug -Trace 1
           curl.exe -fsSL -o cygwin-setup.exe --retry 3 $(CYGWIN_SETUP)

+ 33 - 0
extra/azure-pipelines/install-neko-snapshot.yaml

@@ -0,0 +1,33 @@
+parameters:
+  platform: '' # can be linux64, mac, windows, or windows64
+
+steps:
+  - ${{ if startsWith(parameters.platform, 'windows') }}:
+    - powershell: |
+        Invoke-WebRequest https://build.haxe.org/builds/neko/${{parameters.platform}}/neko_latest.zip -OutFile $(Agent.TempDirectory)/neko_latest.zip
+        Expand-Archive $(Agent.TempDirectory)/neko_latest.zip -DestinationPath $(Agent.TempDirectory)
+        $NEKOPATH = Get-ChildItem $(Agent.TempDirectory)/neko-*-win
+        Write-Host "##vso[task.prependpath]$NEKOPATH"
+        Write-Host "##vso[task.setvariable variable=NEKOPATH]$NEKOPATH"
+      displayName: Install Neko using snapshot from S3
+  - ${{ if not(startsWith(parameters.platform, 'windows')) }}:
+    - bash: |
+        set -ex
+        DOWNLOADDIR=$(Agent.TempDirectory)
+        curl -sSL https://build.haxe.org/builds/neko/${{parameters.platform}}/neko_latest.tar.gz -o $(Agent.TempDirectory)/neko_latest.tar.gz
+        tar -xf $(Agent.TempDirectory)/neko_latest.tar.gz -C $(Agent.TempDirectory)
+        NEKOPATH=`echo $(Agent.TempDirectory)/neko-*-*`
+        sudo mkdir -p /usr/local/bin
+        sudo mkdir -p /usr/local/lib/neko
+        sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools}  /usr/local/bin/
+        sudo ln -s $NEKOPATH/libneko.*                      /usr/local/lib/
+        sudo ln -s $NEKOPATH/*.ndll                         /usr/local/lib/neko/
+        set +x
+        echo "##vso[task.prependpath]$NEKOPATH"
+        echo "##vso[task.setvariable variable=NEKOPATH]$NEKOPATH"
+      displayName: Install Neko using snapshot from S3
+  - ${{ if eq(parameters.platform, 'linux64') }}:
+    - bash: sudo ldconfig
+      displayName: ldconfig
+  - script: neko -version 2>&1
+    displayName: Print Neko version