Skip to content

Update build.yaml

Update build.yaml #12

Workflow file for this run

name: Build
permissions: write-all
on:
push:
branches:
- main
- build
workflow_dispatch:
jobs:
build:
runs-on: windows-2019
defaults:
run:
shell: pwsh
steps:
- uses: actions/cache/restore@v3
id: cache-msys-restore
with:
path: ${{ runner.temp }}/msys64
key: ${{ runner.os }}-msys
- uses: msys2/setup-msys2@v2
if: steps.cache-msys-restore.outputs.cache-hit != 'true'
with:
install: >-
gcc
python
make
rsync
git
gettext-devel
libreadline-devel
- uses: actions/cache/save@v3
with:
path: ${{ runner.temp }}/msys64
key: ${{ steps.cache-msys-restore.outputs.cache-primary-key }}
- name: setup scoop
run: |-
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser # Optional: Needed to run a remote script the first time
Invoke-WebRequest get.scoop.sh -OutFile install.ps1
./install.ps1 -RunAsAdmin -ScoopDir ${{ runner.temp }}\scoop
scoop install pandoc
- name: Detect git
run: |-
$GIT_PATH = (Get-Item (Get-Command git).Source).Directory.FullName
echo "GIT_PATH=$GIT_PATH" >> $ENV:GITHUB_ENV
- name: Detect msys
run: |-
$MSYS_HOME = "${{ runner.temp }}\msys64"
ls $MSYS_HOME
$scoop_shims = '/'+(Get-Item ${{ runner.temp }}\scoop\shims).ToString().Replace(':\','/').Replace('\','/')
echo "export PATH=`$PATH:$scoop_shims" > $MSYS_HOME\etc\profile.d\scoop.sh
"$MSYS_HOME" >> $env:GITHUB_PATH
echo "MSYS_HOME=$MSYS_HOME" >> $ENV:GITHUB_ENV
- uses: actions/checkout@v3
with:
repository: QZLin/bup-pkgbuild-msys
ref: main
- uses: actions/checkout@v3
with:
repository: QZLin/bup-msys
ref: msys
path: src/bup-0.34
- name: build bup
working-directory: ${{ github.workspace }}
run: |-
function msys($command){msys2_shell.cmd -here -ucrt64 -defterm -no-start -c $command}
msys 'pwd'
msys 'makepkg'
ls
echo OUTPUT=$((ls -Filter "*.pkg.tar.zst")[0].Name) >> $ENV:GITHUB_ENV
- name: Pack and upload
uses: actions/upload-artifact@v3
with:
name: debug
path: ${{ env.OUTPUT }}