[ImgBot] Optimize images (#863) #949
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
on: | |
push: | |
branches: | |
- dev | |
- test-builds | |
- actions-testing | |
name: Continuous Delivery | |
jobs: | |
buildNightlyDocker: | |
name: Build and Push Docker Image | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- uses: actions/cache@v3 | |
with: | |
path: /tmp/buildxcache | |
key: ${{ runner.os }}-docker-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-docker-buildx- | |
- name: Docker Login | |
env: | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
run: | | |
echo "${DOCKER_PASSWORD}" | docker login -u ${DOCKER_USERNAME} --password-stdin | |
- name: Build/Push Nightly Docker | |
run: | | |
docker buildx build \ | |
--platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 \ | |
--output "type=image,push=true" \ | |
--tag difegue/lanraragi:nightly \ | |
--cache-from "type=local,src=/tmp/buildxcache" \ | |
--cache-to "type=local,dest=/tmp/buildxcache" \ | |
--file ./tools/build/docker/Dockerfile . | |
exportDockerRootFS: | |
name: Build and export Docker rootfs for Windows build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Docker Build and export | |
run: | | |
docker build -t difegue/lanraragi -f ./tools/build/docker/Dockerfile --build-arg INSTALL_PARAMETER=-w . | |
docker create --name rootfs difegue/lanraragi | |
docker export --output=package.tar rootfs | |
- name: Upload rootfs | |
uses: actions/upload-artifact@v1 | |
with: | |
name: package | |
path: package.tar | |
buildNightlyWSL: | |
name: Build Nightly Windows Package | |
needs: exportDockerRootFS | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Download package | |
uses: actions/download-artifact@v1 | |
with: | |
name: package | |
- name: Build MSI Installer | |
shell: powershell | |
run: | | |
[array]$installPath = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -property installationpath | |
# Get first line of installPath in case we have multiple VS installs | |
Import-Module (Join-Path $installPath[0] "Common7\Tools\Microsoft.VisualStudio.DevShell.dll") | |
# Import the VS shell module | |
Enter-VsDevShell -VsInstallPath $installPath[0] -SkipAutomaticLocation | |
$ErrorActionPreference = 'Continue' | |
git submodule init | |
git submodule update | |
choco install nuget.commandline | |
./tools/build/windows/build.ps1 | |
- name: Upload Installer | |
uses: actions/upload-artifact@v1 | |
with: | |
name: LANraragi.msi | |
path: ./tools/build/windows/Karen/Setup/bin/LANraragi.msi |