.github/workflows/utility-prerelease.yml #101
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v3 | |
- 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@v3 | |
- 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 }} |