Skip to content

Commit

Permalink
wip 1719880558
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Heath <[email protected]>
  • Loading branch information
Jason Heath committed Jul 2, 2024
1 parent 1055496 commit 8481e2a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
10 changes: 5 additions & 5 deletions .github/actions/hab-install-windows/action.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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"
10 changes: 5 additions & 5 deletions .github/actions/hab-pkg-build-and-upload-windows/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
24 changes: 22 additions & 2 deletions .github/workflows/hab-pkg-build-upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8481e2a

Please sign in to comment.