Skip to content

.github/workflows/utility-prerelease.yml #544

.github/workflows/utility-prerelease.yml

.github/workflows/utility-prerelease.yml #544

on:
push:
branches:
- 'build-pkg-*'
schedule:
- cron: '15 1 * * *'
workflow_dispatch:
jobs:
info:
if: github.repository == 'hashicorp/vagrant-vmware-desktop-builder'
name: Generate information
runs-on: ['self-hosted', 'ondemand', 'linux', 'type=t3.small']
permissions:
id-token: write
contents: write
outputs:
utility-version: ${{ steps.inspect.outputs.utility-version }}
utility-pkgs-version: ${{ steps.inspect.outputs.utility-pkgs-version }}
utility-pkgs-release-exists: ${{ steps.inspect.outputs.utility-pkgs-release-exists }}
steps:
- name: Authentication
id: vault-auth
run: vault-auth
- name: Secrets
id: secrets
uses: hashicorp/vault-action@v2
with:
url: ${{ steps.vault-auth.outputs.addr }}
caCertificate: ${{ steps.vault-auth.outputs.ca_certificate }}
token: ${{ steps.vault-auth.outputs.token }}
secrets:
kv/data/github/hashicorp/vagrant-vmware-desktop-builder vagrant_vmware_desktop_repo_token;
- name: Code Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Gather information
id: inspect
run: ./.ci/utility-pkgs-information
env:
HASHIBOT_TOKEN: ${{ steps.secrets.outputs.vagrant_vmware_desktop_repo_token }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EVENT_NAME: ${{ github.event_name }}
build-packages:
if: github.repository == 'hashicorp/vagrant-vmware-desktop-builder' && needs.info.outputs.utility-pkgs-release-exists != 'true'
name: Build packages
needs: [info]
permissions:
contents: write
id-token: write
uses: ./.github/workflows/build-utility-packages.yml
secrets: inherit
prerelease:
if: github.repository == 'hashicorp/vagrant-vmware-desktop-builder'
needs: [info, build-packages]
runs-on: ['self-hosted', 'ondemand', 'linux', 'type=t3.small']
permissions:
id-token: write
contents: write
steps:
- name: Authentication
id: vault-auth
run: vault-auth
- name: Secrets
id: secrets
uses: hashicorp/vault-action@v2
with:
url: ${{ steps.vault-auth.outputs.addr }}
caCertificate: ${{ steps.vault-auth.outputs.ca_certificate }}
token: ${{ steps.vault-auth.outputs.token }}
secrets:
kv/data/github/hashicorp/vagrant-vmware-desktop-builder vagrant_vmware_desktop_repo_token;
- name: Code Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Fetch linux packages
run: ./.ci/restore-cache "${CACHE_ID}" ./pkg
env:
CACHE_ID: ${{ needs.build-packages.outputs.linux-cache-id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch macOS packages
run: ./.ci/restore-cache "${CACHE_ID}" ./pkg
env:
CACHE_ID: ${{ needs.build-packages.outputs.macos-cache-id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch windows packages
run: ./.ci/restore-cache "${CACHE_ID}" ./pkg
env:
CACHE_ID: ${{ needs.build-packages.outputs.windows-cache-id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish release
run: ./.ci/utility-packages-prerelease "${UTILITY_VERSION}" ./pkg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HASHIBOT_TOKEN: ${{ steps.secrets.outputs.vagrant_vmware_desktop_repo_token }}
UTILITY_VERSION: ${{ needs.info.outputs.utility-pkgs-version }}
EVENT_NAME: ${{ github.event_name }}