Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gha): add release-please #481

Merged
merged 1 commit into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 25 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ on:
ANSIBLE_DEBUG:
type: choice
description: ANSIBLE_DEBUG (true, false)
default: "false"
options:
- "false"
- "true"
Expand All @@ -54,7 +53,6 @@ on:
build_upload:
type: choice
description: Upload release to Vagrant Cloud
default: "false"
options:
- "false"
- "true"
Expand All @@ -63,6 +61,7 @@ on:
- cron: "0 1 1 * *"

env:
PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PACKER_IMAGES_OUTPUT_DIR: /var/tmp/packer-templates-images
PACKER_CACHE_DIR: /var/tmp/packer_cache
LOGDIR: /var/tmp/packer-templates-logs
Expand Down Expand Up @@ -196,26 +195,39 @@ jobs:
- name: Install packages
run: |
set -euxo pipefail
# Remove unused packages to save some disk space
rm -rf /Users/runner/Library/Developer /Users/runner/Library/Android /Users/runner/hostedtoolcache /Users/runner/.dotnet
brew update
brew install bash coreutils gnu-sed jq packer hudochenkov/sshpass/sshpass vagrant
brew install ansible bash coreutils gnu-sed jq packer hudochenkov/sshpass/sshpass hashicorp/tap/hashicorp-vagrant

if [[ "${PACKER_VAGRANT_PROVIDER}" = "libvirt" ]]; then
brew install qemu xorriso
qemu-system-x86_64 --version
fi

if [[ "${PACKER_VAGRANT_PROVIDER}" = "virtualbox" ]]; then
brew install virtualbox
vboxmanage --version
fi
# renovate: datasource=pypi depName=ansible
ANSIBLE_VERSION="9.2.0"
pip3 install ansible=="${ANSIBLE_VERSION}"

packer plugins install github.com/hashicorp/ansible
packer plugins install github.com/hashicorp/qemu
packer plugins install github.com/hashicorp/vagrant
packer plugins install github.com/hashicorp/virtualbox

vagrant --version
packer --version
ansible --version

if [[ "${BUILD}" =~ windows ]]; then
# renovate: datasource=pypi depName=pywinrm
PYWINRM_VERSION="0.4.3"
pip3 install pywinrm=="${PYWINRM_VERSION}"
ansible-galaxy collection install -v -r ansible/requirements.yml
ansible-galaxy collection install --force -r ansible/requirements.yml
fi

echo "/usr/local/bin:/usr/local/opt/gnu-sed/libexec/gnubin:/usr/local/opt/coreutils/libexec/gnubin" >> "${GITHUB_PATH}"

# Remove unused packages to save some disk space
rm -rf /Users/runner/Library/Developer /Users/runner/Library/Android /Users/runner/hostedtoolcache /Users/runner/.dotnet

# Used by mxschmitt/action-tmate
touch continue

Expand All @@ -230,12 +242,12 @@ jobs:
./build.sh "${BUILD}"

- name: Upload logs to GitHub artifact store in case of VirtualBox failure
uses: actions/upload-artifact@v4
if: ${{ always() && (steps.build_image.outcome == 'failure') && contains(matrix.stage, 'virtualbox') }}
uses: actions/upload-artifact@v3
if: ${{ always() && contains(matrix.stage, 'virtualbox') }}
with:
name: ${{ matrix.stage }}
path: ${{ env.LOGDIR }}/*
retention-days: 1
retention-days: 3

- name: Check the created box image
run: |
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: release-please

on:
workflow_dispatch:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release-please-pr:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@cc61a07e2da466bebbc19b3a7dd01d6aecb20d1e # v4.0.2
with:
release-type: simple
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,3 @@ packer_cache/

# pre-commit config file
.pre-commit-config.yaml

# release-it configuration file
.release-it.yml