Roll to 2.3.0 and update changelog (#272) #25
Workflow file for this run
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 binaries | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
compile-gui: | |
# Compile the GUI on Windows & Linux, and write the GUI binaries to actions/cache | |
name: Compile GUI | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- | |
name: Checkout code | |
uses: actions/checkout@v4 | |
- | |
name: Fetch cached compiled GUI | |
id: restore-compiled-gui | |
uses: actions/cache/restore@v4 | |
with: | |
# enableCrossOsArchive always needs to be set on cached items in Windows jobs | |
# see cache documentation: https://github.com/actions/cache#inputs | |
enableCrossOsArchive: true | |
path: gui/dist/cloudfuseGUI_${{ runner.os }} | |
key: ${{ runner.os }}-compiled-gui-${{ hashFiles('gui/*.ui', 'gui/*.py') }} | |
- | |
name: Install Python | |
if: ${{ ! steps.restore-compiled-gui.outputs.cache-hit }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- | |
name: Install pip dependencies | |
if: ${{ ! steps.restore-compiled-gui.outputs.cache-hit }} | |
run: pip3 install -r gui/requirements.txt | |
shell: bash | |
- | |
name: Install libxcb-cursor0 | |
if: ${{ ! steps.restore-compiled-gui.outputs.cache-hit && matrix.os == 'ubuntu-latest' }} | |
run: |- | |
sudo apt-get update | |
sudo apt-get install libxcb-cursor0 -y | |
- | |
name: Compile GUI | |
if: ${{ ! steps.restore-compiled-gui.outputs.cache-hit }} | |
shell: bash | |
run: | | |
cd gui | |
./create_gui.sh | |
mv dist/cloudfuseGUI dist/cloudfuseGUI_${{ runner.os }} | |
- | |
name: Cache compiled GUI | |
if: ${{ ! steps.restore-compiled-gui.outputs.cache-hit }} | |
uses: actions/cache/save@v4 | |
with: | |
enableCrossOsArchive: true | |
path: gui/dist/cloudfuseGUI_${{ runner.os }} | |
key: ${{ runner.os }}-compiled-gui-${{ hashFiles('gui/*.ui', 'gui/*.py') }} | |
create-installer: | |
# Run Inno Setup to create the Windows app installer, then write it to actions/cache | |
name: Create Windows Installer | |
needs: compile-gui | |
runs-on: windows-latest | |
env: | |
go: '1.22' | |
cgo: '0' | |
winfsp: winfsp-2.0.23075.msi | |
steps: | |
- # Build the command-line program | |
name: Checkout code | |
uses: actions/checkout@v4 | |
- | |
name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.go }} | |
check-latest: true | |
- | |
name: Set CGO | |
shell: bash | |
run: | | |
if [[ "${{ env.cgo }}" != "" ]]; then echo 'CGO_ENABLED=${{ env.cgo }}' >> $GITHUB_ENV ; fi | |
- | |
name: Build | |
shell: bash | |
run: | | |
commitDate=$(TZ=UTC0 git log -1 --format=%cd --date=format-local:%Y-%m-%dT%H:%M:%SZ) | |
ldflags="-s -w -X github.com/Seagate/cloudfuse/common.GitCommit=${{ github.sha }} -X github.com/Seagate/cloudfuse/common.CommitDate=$commitDate" | |
go build -trimpath -ldflags ''"$ldflags"'' -o cloudfuse.exe | |
go build -trimpath -ldflags ''"$ldflags"'' -o cfusemon.exe ./tools/health-monitor/ | |
go build -trimpath -ldflags ''"$ldflags"'' -o windows-startup.exe ./tools/windows-startup/ | |
touch -m -d $commitDate cloudfuse.exe | |
touch -m -d $commitDate cfusemon.exe | |
touch -m -d $commitDate windows-startup.exe | |
- # Get the WinFSP installer (from cache or download) | |
name: Get cached WinFSP installer | |
id: restore-winfsp-installer | |
uses: actions/cache/restore@v4 | |
with: | |
path: ${{ env.winfsp }} | |
key: ${{ env.winfsp }} | |
- | |
name: Download WinFSP installer | |
if: ${{ ! steps.restore-winfsp-installer.outputs.cache-hit }} | |
shell: bash | |
run: | | |
curl -LOf https://github.com/winfsp/winfsp/releases/download/v2.0/${{ env.winfsp }} | |
- | |
name: Cache WinFSP installer | |
if: ${{ ! steps.restore-winfsp-installer.outputs.cache-hit }} | |
uses: actions/cache/save@v4 | |
with: | |
path: ${{ env.winfsp }} | |
key: ${{ env.winfsp }} | |
- | |
name: Fetch cached compiled GUI | |
uses: actions/cache/restore@v4 | |
with: | |
enableCrossOsArchive: true | |
path: gui/dist/cloudfuseGUI_${{ runner.os }} | |
key: ${{ runner.os }}-compiled-gui-${{ hashFiles('gui/*.ui', 'gui/*.py') }} | |
fail-on-cache-miss: true | |
# don't continue if we fail get the compiled GUI for the Windows installer | |
continue-on-error: false | |
- # Build the installer and save it to actions/cache | |
name: Create PFX KeyCert File | |
working-directory: ./build | |
shell: bash | |
run: | | |
echo "${{ secrets.INSTALLER_SIGNATURE_PRIVATE_KEY }}" >> combined.pem | |
cat codeSigning.crt >> combined.pem | |
cat combined.pem | openssl pkcs12 -export -out signingKey.pfx -passout pass: | |
rm combined.pem | |
- | |
name: Prep Inno Setup Script | |
working-directory: ./build | |
shell: bash | |
# Inno Setup is pre-installed on GitHub's windows-latest image | |
# see documentation: https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md | |
run: | | |
printf '%s ' >run-iscc.bat \ | |
'"C:/Program Files (x86)/Inno Setup 6/iscc.exe"' \ | |
'"/Ssigntool=$qC:\Program Files (x86)\Windows Kits\10\App Certification Kit\signtool.exe$q' \ | |
'sign /fd SHA256 /a /f $q${{ github.workspace }}\build\signingKey.pfx$q' \ | |
'/n $qSEAGATE TECHNOLOGY LLC$q /t http://timestamp.digicert.com $p"' \ | |
"windows_installer_build.iss" | |
- | |
name: Run Inno Setup | |
working-directory: ./build | |
run: | | |
.\run-iscc.bat | |
- | |
name: Set Version | |
id: get_version | |
run: echo "::set-output name=VERSION::$( echo ${{github.ref_name}} | tr -d 'v' )" | |
- | |
name: Rename installer | |
run: | | |
mv build/Output/cloudfuse.exe build/Output/cloudfuse_${{ steps.get_version.outputs.VERSION }}_windows_amd64.exe | |
- | |
name: Cache windows installer | |
uses: actions/cache/save@v4 | |
with: | |
enableCrossOsArchive: true | |
path: build/Output/cloudfuse_${{ steps.get_version.outputs.VERSION }}_windows_amd64.exe | |
key: windows-cloudfuse-installer-${{ github.sha }} | |
release: | |
# Use GoReleaser to package and publish Linux releases along with the Windows installer | |
name: Release Binaries | |
needs: create-installer | |
runs-on: ubuntu-latest | |
env: | |
go: '1.22' | |
zig: 0.12.0 | |
steps: | |
- # libfuse-dev is required to build our command-line program | |
name: Install Libfuse | |
run: | | |
sudo apt-get install -y libfuse-dev | |
- # enable GoReleaser to build for ARM64 | |
name: Install ARM64 compilers | |
run: | | |
sudo apt-get install -y gcc-aarch64-linux-gnu | |
- # Get code and Go ready | |
name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Zig | |
run: | | |
curl -L https://ziglang.org/download/${{ env.zig }}/zig-linux-x86_64-${{ env.zig }}.tar.xz -o zig.tar.xz | |
mkdir -p $HOME/.local/bin | |
tar -xf zig.tar.xz -C $HOME/.local/bin | |
echo "$HOME/.local/bin/zig-linux-x86_64-${{ env.zig }}" >> $GITHUB_PATH | |
rm zig.tar.xz | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.go }} | |
check-latest: true | |
- | |
name: Set Version | |
id: get_version | |
run: echo "::set-output name=VERSION::$( echo ${{github.ref_name}} | tr -d 'v' )" | |
- # Get cached intermediate build products | |
name: Restore cached Windows installer | |
uses: actions/cache/restore@v4 | |
with: | |
enableCrossOsArchive: true | |
path: build/Output/cloudfuse_${{ steps.get_version.outputs.VERSION }}_windows_amd64.exe | |
key: windows-cloudfuse-installer-${{ github.sha }} | |
fail-on-cache-miss: true | |
- | |
name: Restore Linux compiled GUI | |
uses: actions/cache/restore@v4 | |
with: | |
path: gui/dist/cloudfuseGUI_Linux | |
key: Linux-compiled-gui-${{ hashFiles('gui/*.ui', 'gui/*.py') }} | |
fail-on-cache-miss: true | |
continue-on-error: false | |
- | |
name: Restore Windows compiled GUI | |
uses: actions/cache/restore@v4 | |
with: | |
enableCrossOsArchive: true | |
path: gui/dist/cloudfuseGUI_Windows | |
key: Windows-compiled-gui-${{ hashFiles('gui/*.ui', 'gui/*.py') }} | |
# the hash value comes out different on Linux vs Windows | |
# so we need to use restore-keys to match the Windows compiled GUI | |
# see documentation: https://github.com/actions/cache/blob/main/restore/README.md#inputs | |
restore-keys: Windows-compiled-gui- | |
continue-on-error: false | |
- # Run GoReleaser (see .goreleaser.yaml) | |
name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |