From 8481e2aaa2b5570752e5518ebe38f83ae2f41a33 Mon Sep 17 00:00:00 2001 From: Jason Heath Date: Mon, 1 Jul 2024 20:35:58 -0400 Subject: [PATCH] wip 1719880558 Signed-off-by: Jason Heath --- .../actions/hab-install-windows/action.yaml | 10 ++++---- .../action.yaml | 10 ++++---- .github/workflows/hab-pkg-build-upload.yaml | 24 +++++++++++++++++-- 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/.github/actions/hab-install-windows/action.yaml b/.github/actions/hab-install-windows/action.yaml index 11eb554b2..a4dda14dd 100644 --- a/.github/actions/hab-install-windows/action.yaml +++ b/.github/actions/hab-install-windows/action.yaml @@ -1,8 +1,8 @@ name: Habitat Install for Linux description: Install Habitat via curl bash on linux hosts inputs: - curl-bash-url: - description: URL of the habitat curl bash script + url: + description: URL of the habitat install.ps1 script required: true default: 'https://raw.githubusercontent.com/habitat-sh/habitat/main/components/hab/install.ps1' habitat-version: @@ -19,10 +19,10 @@ runs: - name: hab curl bash install shell: pwsh env: - URL: ${{ inputs.curl-bash-url }} + URL: ${{ inputs.url }} VERSION: ${{ inputs.habitat-version }} TARGET: ${{ inputs.habitat-target }} run: | - write-output "--- STARTING HAB INSTALL ON ${{ matrix.os }} WINDOWS with habitat version:${{env.VERSION}}" + write-output "--- STARTING HAB INSTALL ON ${{ matrix.os }} WINDOWS with habitat version:$env:VERSION" $env:HAB_LICENSE = "accept-no-persist" - Invoke-Expression "& { $(Invoke-RestMethod $env.URL) } -Version ${{env.VERSION}}" + Invoke-Expression "& { $(Invoke-RestMethod $env:URL) } -Version $env:VERSION" diff --git a/.github/actions/hab-pkg-build-and-upload-windows/action.yaml b/.github/actions/hab-pkg-build-and-upload-windows/action.yaml index ccd5b30c4..c7374bfea 100644 --- a/.github/actions/hab-pkg-build-and-upload-windows/action.yaml +++ b/.github/actions/hab-pkg-build-and-upload-windows/action.yaml @@ -30,19 +30,19 @@ runs: BUILD_DATE_TIME: ${{ inputs.build-date-time}} run: | - $env:BUILD_ARGS = "-X 'main.git_sha=${{ github.sha }}' -X 'main.version=${{ env.APP_VERSION }}' -X 'main.build_date_time=${{ env.BUILD_DATE_TIME }}'" + $env:BUILD_ARGS = "-X 'main.git_sha=${{ github.sha }}' -X 'main.version=$env:APP_VERSION' -X 'main.build_date_time=$env:BUILD_DATE_TIME'" $env:Path += ";C:\ProgramData\Habitat" $env:GITHUB_TOKEN="${{ secrets.GH_TOKEN }}" hab license accept - hab origin key download ${{ env.HAB_ORIGIN }} - hab origin key download --auth ${{ env.HAB_AUTH_TOKEN }} --secret ${{ env.HAB_ORIGIN }} + hab origin key download $env:HAB_ORIGIN + hab origin key download --auth $env:HAB_AUTH_TOKEN --secret $env:HAB_ORIGIN write-output "--- hab pkg build $BLDR_COMPONENT" - hab pkg build $env.BLDR_COMPONENT + hab pkg build $env:BLDR_COMPONENT write-output "--- build successfully" . results\last_build.ps1 write-output "--- hab pkg upload --auth elided-HAB_AUTH_TOKEN results/$pkg_artifact" - hab pkg upload --auth ${{ env.HAB_AUTH_TOKEN }} results\$pkg_artifact + hab pkg upload --auth $env:HAB_AUTH_TOKEN results\$pkg_artifact write-output "--- uploaded successfully" diff --git a/.github/workflows/hab-pkg-build-upload.yaml b/.github/workflows/hab-pkg-build-upload.yaml index db740dab5..2a5fe67fa 100644 --- a/.github/workflows/hab-pkg-build-upload.yaml +++ b/.github/workflows/hab-pkg-build-upload.yaml @@ -83,21 +83,24 @@ jobs: components: [builder-api, builder-api-proxy, builder-graph, builder-jobsrv, builder-minio] runs-on: ${{matrix.os}} steps: + - name: Checkout for ${{matrix.components}} uses: actions/checkout@v4 + - name: Install Habitat for ${{matrix.components}} uses: ./.github/actions/hab-install-linux + - name: Build and Upload Habitat Package for ${{matrix.components}} uses: ./.github/actions/hab-pkg-build-and-upload-linux with: hab-auth-token: ${{ env.HAB_AUTH_TOKEN }} hab-origin: ${{ env.HAB_ORIGIN }} bldr-component: components/${{matrix.components}}/habitat + - name: Upload HART file artifact for reuse in habitat-dev plans uses: actions/upload-artifact@v4 with: name: hart-files - # path: /hab/cache/artifacts/${{env.HAB_ORIGIN}}*.hart path: results/${{env.HAB_ORIGIN}}*.hart if-no-files-found: error retention-days: 1 @@ -110,7 +113,7 @@ jobs: # - don't have a habitat-dev plan directory # - have architecture specific plan directories arch-target-packages: - name: ${{matrix.components}} ${{matrix.arches}} hab pkg (plan file) + name: ${{matrix.arches}} ${{matrix.components}} hab pkg (plan file) needs: windows-pre-build strategy: fail-fast: false @@ -119,6 +122,13 @@ jobs: channel: [unstable] components: [builder-worker] arches: [x86_64-linux, x86_64-linux-kernel2, x86_64-windows] + exclude: + - os: ubuntu-latest + arches: x86_64-windows + - os: windows-latest + arches: x86_64-linux + - os: windows-latest + arches: x86_64-linux-kernel2 runs-on: ${{matrix.os}} steps: @@ -149,6 +159,16 @@ jobs: app-version: ${{ needs.pre-build.outputs.app_version }} build-date-time: ${{ needs.pre-build.outputs.date }} + - name: Upload HART file artifact for reuse in habitat-dev plans + uses: actions/upload-artifact@v4 + with: + name: hart-files + path: results/${{env.HAB_ORIGIN}}*.hart + if-no-files-found: error + retention-days: 1 + compression-level: 0 + overwrite: true + # # These particular components # # - don't have a plan.sh file in their "component root" # # - don't have a habitat plan directory