Skip to content

Commit

Permalink
update windows installer manifest
Browse files Browse the repository at this point in the history
add gtk4.14 base image
  • Loading branch information
Kosette committed Oct 4, 2024
1 parent 3fd1820 commit 02d5beb
Show file tree
Hide file tree
Showing 13 changed files with 931 additions and 164 deletions.
54 changes: 31 additions & 23 deletions .github/workflows/build_image.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Push Ubuntu-rust-gtk4
name: Build and Push ubuntu-rust-gtk4
on:
workflow_dispatch:
# push:
Expand All @@ -20,8 +20,20 @@ jobs:
include:
- platform: amd64
arch: amd64
codename: oracular
gtk: 416
- platform: arm64
arch: arm64v8
codename: oracular
gtk: 416
- platform: amd64
arch: amd64
codename: noble
gtk: 414
- platform: arm64
arch: arm64v8
codename: noble
gtk: 414

steps:
- uses: actions/checkout@v4
Expand All @@ -43,16 +55,17 @@ jobs:
run: |
echo "OWNER=${GITHUB_REPOSITORY_OWNER@L}" >> ${GITHUB_ENV}
- name: Build and push for ${{ matrix.platform }}
- name: Build and push ${{ matrix.platform }}
uses: docker/build-push-action@v6
with:
context: docker
platforms: linux/${{ matrix.platform }}
push: true
tags: |
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:${{ matrix.platform }}
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:gtk${{ matrix.gtk }}-${{ matrix.platform }}
build-args: |
ARCH=${{ matrix.arch }}
CODENAME=${{ matrix.codename }}
provenance: false

merge:
Expand All @@ -71,34 +84,29 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Metadata
id: date
run: |
echo "OWNER=${GITHUB_REPOSITORY_OWNER@L}" >> ${GITHUB_ENV}
echo "date=$(date --rfc-3339=date)" >> ${GITHUB_OUTPUT}
- name: Create multi-arch manifest for latest tag
- name: Create multi-arch manifest for gtk4.16/latest
run: |
docker manifest create ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:latest \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:amd64 \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:arm64
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:gtk416-amd64 \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:gtk416-arm64
docker manifest annotate ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:latest \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:amd64 --arch amd64
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:gtk416-amd64 --arch amd64
docker manifest annotate ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:latest \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:arm64 --arch arm64
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:gtk416-arm64 --arch arm64
docker manifest push ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:latest
- name: Create multi-arch manifest for date tag
- name: Create multi-arch manifest for gtk4.14
run: |
docker manifest create ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:${{ steps.date.outputs.date }} \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:amd64 \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:arm64
docker manifest annotate ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:${{ steps.date.outputs.date }} \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:amd64 --arch amd64
docker manifest annotate ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:${{ steps.date.outputs.date }} \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:arm64 --arch arm64
docker manifest push ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:${{ steps.date.outputs.date }}
docker manifest create ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:gtk414-latest \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:gtk414-amd64 \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:gtk414-arm64
docker manifest annotate ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:gtk414-latest \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:gtk414-amd64 --arch amd64
docker manifest annotate ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:gtk414-latest \
ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:gtk414-arm64 --arch arm64
docker manifest push ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:gtk414-latest
- name: Check push
run: |
docker buildx imagetools inspect ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:latest
docker buildx imagetools inspect ghcr.io/${{ env.OWNER }}/ubuntu-rust-gtk4:gtk414-latest
29 changes: 15 additions & 14 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ on:
- ".gitignore"
- LICENSE
- "*.md"
pull_request:
branches:
- "dev"
paths-ignore:
- "docs/**"
- "**/.gitignore"
- "**/.dockerignore"
- LICENSE
- "**/*.md"
# pull_request:
# branches:
# - "dev"
# paths-ignore:
# - "docs/**"
# - "**/.gitignore"
# - "**/.dockerignore"
# - LICENSE
# - "**/*.md"

jobs:
build:
Expand All @@ -27,8 +27,8 @@ jobs:
include:
- platform: amd64
arch: x86_64
- platform: arm64
arch: aarch64
# - platform: arm64
# arch: aarch64

steps:
- uses: actions/checkout@v4
Expand All @@ -43,9 +43,9 @@ jobs:
run: |
echo "user=${GITHUB_REPOSITORY_OWNER@L}" >> ${GITHUB_ENV}
- name: Build Rust project
- name: Build tsukimi for ${{ matrix.platform }}
run: |
docker run --rm --platform linux/${{matrix.platform}} -v ${{ github.workspace }}:/app ghcr.io/${{ env.user }}/ubuntu-rust-gtk4:latest
docker run --rm --platform linux/${{matrix.platform}} -v ${{ github.workspace }}:/app -v ./docker/entrypoint.sh:/entrypoint.sh ghcr.io/${{ env.user }}/ubuntu-rust-gtk4:latest
sudo cp target/release/tsukimi .
sudo cp target/debian/*.deb .
sudo cp -r i18n/locale .
Expand All @@ -56,5 +56,6 @@ jobs:
name: tsukimi-${{matrix.arch}}-linux
path: |
tsukimi
moe.*.xml
*.deb
moe*.xml
locale/
46 changes: 26 additions & 20 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ on:
- ".gitignore"
- LICENSE
- "**/*.md"
pull_request:
branches:
- "dev"
paths-ignore:
- "docs/**"
- ".gitignore"
- LICENSE
- "**/*.md"
# pull_request:
# branches:
# - "dev"
# paths-ignore:
# - "docs/**"
# - ".gitignore"
# - LICENSE
# - "**/*.md"

env:
CARGO_TERM_COLOR: always
Expand All @@ -29,16 +29,12 @@ jobs:
strategy:
matrix:
include:
- arch: x86_64-windows-gnu
os: windows-latest
target: x86_64-pc-windows-gnu
artifact: tsukimi.exe
msystem: mingw64
env: x86_64
- arch: ucrt-x86_64-windows-gnu
# - arch: x86_64-windows-gnu
# os: windows-latest
# msystem: mingw64
# env: x86_64
- arch: ucrt64-x86_64-windows-gnu
os: windows-latest
target: x86_64-pc-windows-gnu
artifact: tsukimi.exe
msystem: ucrt64
env: ucrt-x86_64

Expand Down Expand Up @@ -70,21 +66,21 @@ jobs:
mingw-w64-${{ matrix.env }}-gst-libav
curl
- name: Build tsukimi-${{ matrix.target }}
- name: Build tsukimi-${{ matrix.arch }}
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
shell: msys2 {0}
run: |
export PATH="/c/Users/runneradmin/.cargo/bin:$PATH"
rustup default stable-gnu
cargo build --release --locked -F console
cargo build --release --locked
- name: Prepare Package
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
shell: msys2 {0}
run: |
mkdir artifact && cd artifact
mkdir tsukimi-x86_64-windows-gnu/ && cd tsukimi-x86_64-windows-gnu/ && mkdir bin/ && mkdir share/ && mkdir lib/
cp $GITHUB_WORKSPACE/target/release/${{ matrix.artifact }} bin/
cp $GITHUB_WORKSPACE/target/release/tsukimi.exe bin/
cp /${{ matrix.msystem }}/bin/gdbus.exe bin/
cp -r /${{ matrix.msystem }}/lib/gdk-pixbuf-2.0 lib/
Expand Down Expand Up @@ -122,6 +118,14 @@ jobs:
ldd bin/tsukimi.exe | grep '\/${{ matrix.msystem }}.*\.dll' -o | xargs -I{} cp -n "{}" bin/
find lib/ -type f -name "*.dll" -exec ldd "{}" \; | grep '\/${{ matrix.msystem }}.*\.dll' -o | xargs -I{} cp -n "{}" bin/
- name: Create NSIS installer
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
shell: powershell
run: |
cp ./installer/* artifact
makensis /V4 artifact/tsukimi_installer.nsi
rm artifact/tsukimi_installer.nsi
- name: Build Thin Package
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
shell: powershell
Expand All @@ -135,6 +139,7 @@ jobs:
run: |
cd artifact
sha512sum *.7z > tsukimi.sha512sum
sha512sum *.exe >> tsukimi.sha512sum
- name: Upload artifact
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
Expand All @@ -143,6 +148,7 @@ jobs:
name: tsukimi-${{matrix.arch}}
path: |
artifact/*.7z
artifact/*.exe
artifact/*.sha512sum
compression-level: 0
retention-days: 3
Expand Down
32 changes: 16 additions & 16 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG ARCH=amd64
ARG CODENAME=oracular

FROM $ARCH/ubuntu:oracular
FROM $ARCH/ubuntu:$CODENAME

ENV CARGO_TERM_COLOR=always \
CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse \
Expand Down
Loading

0 comments on commit 02d5beb

Please sign in to comment.