Skip to content

Merge pull request #4046 from nickcaballero/fix/vm-extra-config-copy #5211

Merge pull request #4046 from nickcaballero/fix/vm-extra-config-copy

Merge pull request #4046 from nickcaballero/fix/vm-extra-config-copy #5211

name: Build
permissions:
contents: read
on:
push:
branches: main
pull_request:
branches: main
schedule:
- cron: 0 1 * * *
workflow_dispatch:
concurrency:
group: govmomi-build-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
artifacts:
name: Build Snapshot Release (no upload)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout Repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0 # for CHANGELOG
- name: Setup Go
id: setup-go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod
- name: Restore Go Cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-
- name: Create CHANGELOG
env:
IMAGE: quay.io/git-chglog/git-chglog
# https://quay.io/repository/git-chglog/git-chglog from tag v0.14.2
IMAGE_SHA: 998e89dab8dd8284cfff5f8cfb9e9af41fe3fcd4671f2e86a180e453c20959e3
run: |
# use a pseudo tag to only include changes since last release
NEXT_TAG=$(git describe --abbrev=0 --tags)-next
docker run --rm -v $PWD:/workdir ${IMAGE}@sha256:${IMAGE_SHA} --next-tag ${NEXT_TAG} -o RELEASE_CHANGELOG.md --sort semver --tag-filter-pattern '^v[0-9]+' ${NEXT_TAG}
- name: Archive CHANGELOG
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: CHANGELOG
path: |
./RELEASE_CHANGELOG.md
retention-days: 1
- name: Build Artifacts
uses: goreleaser/goreleaser-action@5daf1e915a5f0af01ddbcd89a43b8061ff4f1a89 # v7.2.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: latest
# Snapshot will disable push/release.
args: release --clean --snapshot --release-notes RELEASE_CHANGELOG.md
- name: Verify git clean
shell: bash
run: |
if [[ -z "$(git status --porcelain)" ]]; then
echo "${{ github.repository }} up to date."
else
echo "${{ github.repository }} is dirty."
echo "::error:: $(git status)"
exit 1
fi
# Make artifacts available for inspection.
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/storing-and-sharing-data-from-a-workflow
- name: Archive Artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: dist
# Upload some artifacts for introspection to keep storage size small.
path: |
dist/govc_*x86_64.tar.gz
dist/vcsim_*x86_64.tar.gz
dist/checksums.txt
retention-days: 1