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

0.21.0-rc.14 #220

Merged
merged 10 commits into from
Dec 9, 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: 38 additions & 0 deletions .github/workflows/check-version-bumped.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Check version is suitable for merge to upstream

on:
pull_request:
branches:
- main
- next

jobs:
check-version:
name: Check version
runs-on: ubuntu-latest

steps:
- name: Checkout this PR
uses: actions/checkout@v4
- name: Determine Cargo version of this PR
id: version-pr
run: |
export CARGO_PKG_VERSION=$(awk -F '["=]' '/^\[(workspace.)?package\]/{p=1} p && /^version[[:space:]]*=/ {gsub(/"/, "", $3); print $3; p=0}' Cargo.toml)
export CARGO_PKG_PRERELEASE=$([[ $CARGO_PKG_VERSION =~ -[0-9A-Za-z]+ ]] && echo "true" || echo "false")
echo "CARGO_PKG_VERSION=${CARGO_PKG_VERSION}" >> $GITHUB_OUTPUT
echo "CARGO_PKG_PRERELEASE=${CARGO_PKG_PRERELEASE}" >> $GITHUB_OUTPUT

- name: Checkout ${{ github.base_ref }}
uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
- name: Determine Cargo version of ${{ github.base_ref }}
id: version-upstream
run: |
export CARGO_PKG_VERSION=$(awk -F '["=]' '/^\[(workspace.)?package\]/{p=1} p && /^version[[:space:]]*=/ {gsub(/"/, "", $3); print $3; p=0}' Cargo.toml)
export CARGO_PKG_PRERELEASE=$([[ $CARGO_PKG_VERSION =~ -[0-9A-Za-z]+ ]] && echo "true" || echo "false")
echo "CARGO_PKG_VERSION=${CARGO_PKG_VERSION}" >> $GITHUB_OUTPUT
echo "CARGO_PKG_PRERELEASE=${CARGO_PKG_PRERELEASE}" >> $GITHUB_OUTPUT

- name: Assert versions are different
run: go run github.com/davidrjonas/semver-cli@latest greater ${{ steps.version-pr.outputs.CARGO_PKG_VERSION }} ${{ steps.version-upstream.outputs.CARGO_PKG_VERSION }}
114 changes: 46 additions & 68 deletions .github/workflows/rust-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,99 +160,77 @@ jobs:
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Restore GTK4
id: cache-gtk4
uses: actions/cache/restore@v3
with:
key: windows-gtk4
path: |
C:\gtk-build

- name: Move git binary
- name: Get latest Win-GTK4 build
if: matrix.platform.os_name == 'Windows'
id: wingtk-install
shell: bash
run: |
Move-Item "C:\Program Files\Git\usr\bin" "C:\Program Files\Git\usr\notbin"
Move-Item "C:\Program Files\Git\bin" "C:\Program Files\Git\notbin"
REPO_OWNER="wingtk" # Replace with the owner of the repository
REPO_NAME="gvsbuild" # Replace with the name of the repository
ASSET_PREFIX="GTK4" # The prefix of the asset you want to download

- name: Build GTK4
continue-on-error: true
id: build-gtk4-fallible
run: |
python -m pip install --user pipx
python -m pipx ensurepath
pipx install gvsbuild
gvsbuild build gtk4 libadwaita librsvg gtksourceview5 --ninja-opts -j2
mkdir -p "${ASSET_PREFIX}"
cd "${ASSET_PREFIX}" || exit 1

- name: Build GTK4 with known good gvsbuild (${{ vars.GVSBUILD_KNOWN_GOOD_VERSION }})
if: steps.build-gtk4-fallible.outcome == 'failure'
run: |
python -m pip install --user pipx
python -m pipx ensurepath
pipx install --force gvsbuild==${{ vars.GVSBUILD_KNOWN_GOOD_VERSION }}
gvsbuild build gtk4 libadwaita librsvg gtksourceview5 --ninja-opts -j2
# Get the latest release
RELEASE_INFO=$(curl -s \
"https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/releases/latest")

- name: Restore git binary
run: |
Move-Item "C:\Program Files\Git\usr\notbin" "C:\Program Files\Git\usr\bin"
Move-Item "C:\Program Files\Git\notbin" "C:\Program Files\Git\bin"
# Extract the asset URL that starts with the specified prefix
ASSET_URL=$(echo "$RELEASE_INFO" | jq -r --arg ASSET_PREFIX "$ASSET_PREFIX" \
'.assets[] | select(.name | startswith($ASSET_PREFIX)) | .url')

- name: Save GTK4
uses: actions/cache/save@v3
with:
key: ${{ steps.cache-gtk4.outputs.cache-primary-key }}
path: |
C:\gtk-build
if [ -z "$ASSET_URL" ]; then
echo "No asset found starting with '$ASSET_PREFIX'!"
exit 1
fi

# Download the asset
curl -L \
-H "Accept: application/octet-stream" \
"$ASSET_URL" -o "${ASSET_PREFIX}_asset.zip"

echo "Downloaded asset: ${ASSET_PREFIX}_asset.zip"

unzip "${ASSET_PREFIX}_asset.zip"
rm -f "${ASSET_PREFIX}_asset.zip"
rm -rf "include/" "python/" "wheels/"
BASE_DIR=$(pwd)
echo "BASE_DIR=${BASE_DIR}" >> $GITHUB_OUTPUT

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Tree GVSBuild
shell: pwsh
run: |
tree C:\gtk-build\

- name: Build
shell: pwsh
shell: bash
run: |
$env:PATH="C:\gtk-build\gtk\x64\release\bin;" + $env:PATH
$env:LIB="C:\gtk-build\gtk\x64\release\lib;" + $env:LIB
$env:INCLUDE="C:\gtk-build\gtk\x64\release\include;C:\gtk-build\gtk\x64\release\include\cairo;C:\gtk-build\gtk\x64\release\include\glib-2.0;C:\gtk-build\gtk\x64\release\include\gobject-introspection-1.0;C:\gtk-build\gtk\x64\release\lib\glib-2.0\include;" + $env:INCLUDE
$env:PKG_CONFIG_PATH="C:\gtk-build\gtk\x64\release\lib\pkgconfig;" + $env:PKG_CONFIG_PATH
PATH="${{ steps.wingtk-install.outputs.BASE_DIR }}/bin:$PATH"
LIB="${{ steps.wingtk-install.outputs.BASE_DIR }}/lib:$LIB"
INCLUDE="${{ steps.wingtk-install.outputs.BASE_DIR }}/include:${{ steps.wingtk-install.outputs.BASE_DIR }}/include/cairo:${{ steps.wingtk-install.outputs.BASE_DIR }}/include/glib-2.0:${{ steps.wingtk-install.outputs.BASE_DIR }}/include/gobject-introspection-1.0:${{ steps.wingtk-install.outputs.BASE_DIR }}/lib/glib-2.0/include:$INCLUDE"
PKG_CONFIG_PATH="${{ steps.wingtk-install.outputs.BASE_DIR }}/lib/pkgconfig:$PKG_CONFIG_PATH"

cargo build -p testangel --bin testangel --release
cargo build -p testangel --bin testangel-executor --no-default-features --features cli --release
cargo build -p testangel-evidence --release
cargo build -p testangel-rand --release
cargo build -p testangel-time --release
cargo build -p testangel-user-interaction --release
mkdir build
copy target/release/testangel.exe build/

mkdir -p build/bin

cp target/release/testangel.exe build/bin/
cargo build -p testangel --bin testangel --release --features windows-keep-console-window
copy target/release/testangel.exe build/testangel-dbg.exe
copy target/release/testangel-executor.exe build/
copy C:\gtk-build\gtk\x64\release\bin\*.dll build/
cp target/release/testangel.exe build/bin/testangel-dbg.exe
cp target/release/testangel-executor.exe build/

mkdir build/engines
copy target/release/testangel_evidence.dll build/engines/
copy target/release/testangel_rand.dll build/engines/
copy target/release/testangel_time.dll build/engines/
copy target/release/testangel_user_interaction.dll build/engines/

# GSchemas for FileChooser
mkdir -p build/share/glib-2.0/schemas
copy C:\gtk-build\gtk\x64\release\share\glib-2.0\schemas\gschemas.compiled build/share/glib-2.0/schemas/

# SVG loader for icons
mkdir -p build/lib/gdk-pixbuf-2.0/2.10.0/loaders
copy C:\gtk-build\gtk\x64\release\lib\gdk-pixbuf-2.0\2.10.0\loaders.cache build/lib/gdk-pixbuf-2.0/2.10.0/
copy C:\gtk-build\gtk\x64\release\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-svg.dll build/lib/gdk-pixbuf-2.0/2.10.0/loaders/

# Language Spec
mkdir -p build/language-specs
copy C:\gtk-build\build\x64\release\gtksourceview5\data\language-specs\def.lang build/language-specs
copy C:\gtk-build\build\x64\release\gtksourceview5\data\language-specs\language2.rng build/language-specs
copy C:\gtk-build\build\x64\release\gtksourceview5\data\language-specs\lua.lang build/language-specs

mkdir -p build/styles
copy C:\gtk-build\build\x64\release\gtksourceview5\data\styles\* build/styles
rm -rf ${{ steps.wingtk-install.outputs.BASE_DIR }}/include
cp -r ${{ steps.wingtk-install.outputs.BASE_DIR }}/* bundle/

- name: Save Cargo cache
uses: actions/cache/save@v3
Expand Down
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "0.21.0-rc.13"
version = "0.21.0-rc.14"
edition = "2021"

[workspace]
Expand Down
3 changes: 3 additions & 0 deletions testangel-ipc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
name = "testangel-ipc"
version.workspace = true
edition.workspace = true
authors = [
"Lily Hopkins <[email protected]>",
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
4 changes: 4 additions & 0 deletions testangel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
name = "testangel"
version.workspace = true
edition.workspace = true
authors = [
"Lily Hopkins <[email protected]>",
"Eden Turner <[email protected]>",
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
1 change: 1 addition & 0 deletions testangel/locales/en/main.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ header-save = Save
header-save-as = Save as...
header-close = Close
header-about = About { app-name }
acknowledgements-code-title = Code
acknowledgements-testing-title = Software Testing
acknowledgements-translations-title = Translations

Expand Down
1 change: 1 addition & 0 deletions testangel/locales/sv/main.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ header-save = Spara
header-save-as = Spara som...
header-close = Stäng
header-about = Om { app-name }
acknowledgements-code-title = Kod
acknowledgements-testing-title = Programtestning
acknowledgements-translations-title = Översättningar

Expand Down
Loading
Loading