build(deps): bump sigs.k8s.io/controller-runtime from 0.19.4 to 0.20.1 #589
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
name: release | |
on: | |
pull_request: | |
push: | |
permissions: | |
contents: write | |
jobs: | |
linux: | |
runs-on: ubuntu-24.04 | |
steps: | |
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | |
run: echo "flags=--snapshot" >> $GITHUB_ENV | |
- name: Install dependencies | |
run: | | |
# dpkg --add-architecture arm64 | |
sudo apt update | |
sudo apt install -yq libgtk-4-dev libgtksourceview-5-dev libadwaita-1-dev libgirepository1.0-dev git zip golang-go libglib2.0-dev-bin libvte-2.91-gtk4-dev | |
# apt install -yq gcc-aarch64-linux-gnu libc6-dev-arm64-cross libgtk-4-dev:arm64 libgtksourceview-5-dev:arm64 libadwaita-1-dev:arm64 libgirepository1.0-dev:arm64 | |
git config --global --add safe.directory '*' | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
args: release -f build/linux/.goreleaser.yaml --clean ${{ env.flags }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GOOS: linux | |
- if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
name: Vendor dependencies | |
run: | | |
git archive -o source.zip ${{ github.ref }} | |
go mod vendor | |
sed -i 's/"dev"/"${{ github.ref_name }}"/g' main.go | |
zip -r source.zip vendor main.go | |
- if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
name: Upload source to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: source.zip | |
tag: ${{ github.ref }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: linux | |
path: | | |
dist | |
source.zip | |
windows: | |
needs: linux | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up msys | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: MINGW64 | |
update: true | |
install: | | |
git zip | |
mingw-w64-x86_64-gcc | |
mingw-w64-x86_64-pkg-config | |
mingw-w64-x86_64-gtk4 | |
mingw-w64-x86_64-libadwaita | |
mingw-w64-x86_64-gtksourceview5 | |
mingw-w64-x86_64-gobject-introspection | |
mingw-w64-x86_64-glib2 | |
mingw-w64-x86_64-go | |
- name: Cache Go | |
id: go | |
uses: actions/cache@v4 | |
with: | |
path: ${{ runner.temp }}/msys64/go | |
key: ${{ runner.os }}-go | |
- name: Build | |
run: | | |
set -x | |
git clone --depth 1 --branch go1.22.5 https://github.com/golang/go.git | |
pushd go/src | |
curl https://patch-diff.githubusercontent.com/raw/golang/go/pull/68409.patch | git apply | |
GOROOT_BOOTSTRAP=/mingw64/lib/go cmd //c make.bat | |
popd | |
export PATH="$PWD/go/bin:$PATH" GOROOT="$PWD/go" GOPATH=/go GOCACHE=/go/build | |
#export PATH="/mingw64/bin:$PATH" GOROOT=/mingw64/lib/go GOPATH=/go GOCACHE=/go/build | |
go run github.com/goreleaser/goreleaser@latest build -f build/windows/.goreleaser.yaml --single-target --snapshot | |
dist="$(pwd)/dist/seabird_windows_amd64_v1/" | |
pushd $dist | |
ldd seabird.exe | grep "=> /mingw64/bin/" | cut -d ' ' -f1 | xargs -I{} cp /mingw64/bin/{} . | |
for run in {1..5}; do | |
ldd *.dll | { grep "=> /mingw64/bin/" || true; } | cut -d ' ' -f1 | xargs -I{} cp /mingw64/bin/{} . | |
done | |
cp /mingw64/bin/librsvg*.dll /mingw64/bin/gdbus.exe ../../README.md ../../LICENSE . | |
pushd /mingw64 && cp --parents -r ./share/glib-2.0/schemas/gschemas.compiled ./share/gtk-4.0 ./share/gtksourceview-5 ./share/icons ./lib/gdk-pixbuf-2.0 $dist && popd | |
- uses: caphyon/advinst-github-action@main | |
with: | |
advinst-enable-automation: true | |
- name: Use Advinst Automation | |
shell: pwsh | |
run: | | |
$advinst = new-object -com advancedinstaller | |
$aip = join-path $env:GITHUB_WORKSPACE "build\windows\installer.aip" | |
$project = $advinst.LoadProject($aip) | |
$project.FilesComponent.AddFolderContent($project.PredefinedFolders.ApplicationFolder, "${{ github.workspace }}\dist\seabird_windows_amd64_v1") | |
$exe = $project.FilesComponent.FindFileBySourcePath("${{ github.workspace }}\dist\seabird_windows_amd64_v1\seabird.exe") | |
$shortcut = $project.ShortcutsComponent.CreateFileShortcut($project.PredefinedFolders.ShortcutFolder, $exe) | |
$shortcut.Name = "tmp" # Can't rename from lowercase: "A file with the same name already exists in this folder" | |
$shortcut.Name = "Seabird" | |
$project.BuildComponent.Builds[0].OutputFolder = "${{ github.workspace }}\dist" | |
$project.BuildComponent.Builds[0].PackageName = "seabird_windows_amd64" | |
$tag = git describe --tags --abbrev=0 | |
$project.ProductDetails.Version = $tag.replace('v', '') | |
$project.ProductDetails.ProductCode.GenerateAll() | |
$project.Build() | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: windows | |
path: dist\seabird_windows_amd64.msi | |
if-no-files-found: error | |
- if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: dist\seabird_windows_amd64.msi | |
tag: ${{ github.ref }} | |
darwin: | |
needs: linux | |
strategy: | |
matrix: | |
include: | |
- arch: amd64 | |
builder: macos-13 | |
- arch: arm64 | |
builder: macos-14 | |
name: "darwin-${{ matrix.arch }}" | |
runs-on: ${{ matrix.builder }} | |
steps: | |
- name: Disable XProtect and MDS | |
run: | | |
# https://github.com/actions/runner-images/issues/7522 | |
SERVICES=( | |
"com.apple.XProtect.daemon.scan" | |
"com.apple.metadata.mds" | |
"com.apple.metadata.mds.index" | |
) | |
for SERVICE in "${SERVICES[@]}"; do | |
sudo launchctl stop "${SERVICE}" | |
sudo launchctl disable "system/${SERVICE}" | |
done | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
- name: Install dependencies | |
run: | | |
brew install --force --overwrite gtk4 pkg-config gobject-introspection gtksourceview5 libadwaita hicolor-icon-theme adwaita-icon-theme create-dmg dylibbundler vte3 || true # https://github.com/actions/setup-python/issues/577 | |
- name: Build | |
run: | | |
BUILDCMD="go run github.com/goreleaser/goreleaser@latest build -f build/darwin/.goreleaser.yaml --clean --single-target --snapshot" | |
$BUILDCMD || go clean -cache && $BUILDCMD | |
dist=dist/seabird_darwin_${{ matrix.arch }} | |
[[ "${{ matrix.arch }}" == "amd64" ]] && dist=${dist}_v1 | |
brew_prefix=$(brew --prefix) | |
mkdir -p $dist/lib/gdk-pixbuf-2.0 $dist/share/glib-2.0/schemas $dist/share/icons | |
cp README.md LICENSE build/darwin/seabird.sh $dist | |
dylibbundler -b -d $dist/lib -x $dist/seabird | |
cp -f $brew_prefix/lib/librsvg*.dylib $dist/lib | |
cp -r $brew_prefix/lib/gdk-pixbuf-2.0 $dist/lib | |
sed -i '' "s|$brew_prefix/||" $dist/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache | |
cp -r $brew_prefix/share/glib-2.0/schemas $dist/share/glib-2.0 | |
cp -r $brew_prefix/opt/gtksourceview5/share/gtksourceview-5 $dist/share/gtksourceview-5 | |
cp -r $brew_prefix/opt/gtk4/share/gtk-4.0 $dist/share | |
cp -r $brew_prefix/share/icons/hicolor $brew_prefix/opt/adwaita-icon-theme/share/icons/Adwaita $dist/share/icons | |
mkdir -p dist/dmg/Seabird.app/Contents/MacOS dist/dmg/Seabird.app/Contents/Resources | |
cp build/darwin/icon.icns dist/dmg/Seabird.app/Contents/Resources | |
cp build/darwin/Info.plist dist/dmg/Seabird.app/Contents | |
cp -r $dist/. dist/dmg/Seabird.app/Contents/MacOS | |
set +e | |
false | |
while [ $? -ne 0 ]; do | |
create-dmg --volname Seabird --volicon build/darwin/icon.icns --window-size 600 400 --icon-size 100 --icon "Seabird.app" 200 150 --hide-extension "Seabird.app" --app-drop-link 400 150 seabird_darwin_${{ matrix.arch }}.dmg dist/dmg | |
done | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: darwin_${{ matrix.arch }} | |
path: seabird_darwin_${{ matrix.arch }}.dmg | |
- if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: seabird_darwin_${{ matrix.arch }}.dmg | |
tag: ${{ github.ref }} | |
automerge: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' | |
needs: | |
- linux | |
- windows | |
- darwin | |
steps: | |
- name: Merge | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.pulls.merge({ | |
owner: context.payload.repository.owner.login, | |
repo: context.payload.repository.name, | |
pull_number: context.payload.pull_request.number | |
}) | |
github-token: ${{ github.token }} |