Skip to content

Commit c8e0033

Browse files
committed
Add publication to vagrant registry
1 parent e8da0e1 commit c8e0033

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,24 @@ jobs:
3434
env:
3535
PACKER_GITHUB_API_TOKEN: ${{ secrets.PACKER_GITHUB_API_TOKEN }}
3636
run: PACKER_CACHE_DIR=${{ github.workspace }}/.cache TMPDIR=${{ github.workspace }}/.temp make build-windows-11-24h2-uefi-libvirt
37-
- uses: actions/upload-artifact@v6
37+
- name: Upload box and logs as an artifact
38+
uses: actions/upload-artifact@v6
3839
with:
3940
name: box
4041
path: |
4142
*.box
4243
*.log
4344
*.box.json
45+
- name: Publish to vagrant registry
46+
run: |
47+
VAGRANT_CLOUD_TOKEN=$(curl --silent --fail --show-error \
48+
--header "Content-Type: application/x-www-form-urlencoded" \
49+
--data-urlencode "client_id=${{ secrets.HCP_CLIENT_ID }}" \
50+
--data-urlencode "client_secret=${{ secrets.HCP_CLIENT_SECRET }}" \
51+
--data-urlencode "grant_type=client_credentials" \
52+
--data-urlencode "audience=https://api.hashicorp.cloud" \
53+
"https://auth.idp.hashicorp.com/oauth2/token" | jq -r .access_token)
54+
export VAGRANT_CLOUD_TOKEN
55+
vagrant cloud auth login --check
56+
vagrant cloud box show kppqju77/windows-11-fr-input
57+
vagrant cloud publish kppqju77/windows-11-fr-input "$(cat windows-11*.box.json | jq -r .versions[0].version)" $(cat windows-11*.box.json | jq -r .versions[0].providers[0].name) $(cat windows-11*.box.json | jq -r .versions[0].providers[0].url) --release --no-direct-upload -f

0 commit comments

Comments
 (0)