Test release #72
Workflow file for this run
This file contains hidden or 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 | |
| permissions: {} | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| branches: | |
| - test-release-2.0 | |
| 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4 | |
| with: | |
| persist-credentials: false | |
| - name: Fetch cached compiled GUI | |
| id: restore-compiled-gui | |
| uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # 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@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | |
| with: | |
| python-version: "3.12" | |
| - 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 | |
| env: | |
| OS: ${{ runner.os }} | |
| run: | | |
| cd gui | |
| ./create_gui.sh | |
| mv dist/cloudfuseGUI dist/cloudfuseGUI_${OS} | |
| - name: Cache compiled GUI | |
| if: ${{ ! steps.restore-compiled-gui.outputs.cache-hit }} | |
| uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # 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 | |
| runs-on: windows-latest | |
| env: | |
| go: "1.25" | |
| cgo: "0" | |
| winfsp: winfsp-2.1.25156.msi | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4 | |
| with: | |
| persist-credentials: false | |
| - name: Install Go | |
| uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 | |
| with: | |
| go-version: ${{ env.go }} | |
| check-latest: true | |
| cache: false | |
| - name: Set CGO | |
| shell: bash | |
| run: | | |
| echo 'CGO_ENABLED=0' >> $GITHUB_ENV | |
| - name: Build | |
| shell: bash | |
| env: | |
| SHA: ${{ github.sha }} | |
| 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=${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/ | |
| go build -trimpath -ldflags ''"$ldflags"'' -o windows-service.exe ./tools/windows-service/ | |
| touch -m -d $commitDate cloudfuse.exe | |
| touch -m -d $commitDate cfusemon.exe | |
| touch -m -d $commitDate windows-startup. | |
| touch -m -d $commitDate windows-service.exe | |
| # Get the WinFSP installer (from cache or download) | |
| - name: Get cached WinFSP installer | |
| id: restore-winfsp-installer | |
| uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4 | |
| with: | |
| path: ${{ env.winfsp }} | |
| key: ${{ env.winfsp }} | |
| - name: Download WinFSP installer | |
| if: ${{ ! steps.restore-winfsp-installer.outputs.cache-hit }} | |
| shell: bash | |
| env: | |
| WINFSP: ${{ env.winfsp }} | |
| run: | | |
| curl -LOf https://github.com/winfsp/winfsp/releases/download/v2.1/${{ env.winfsp }} | |
| - name: Cache WinFSP installer | |
| if: ${{ ! steps.restore-winfsp-installer.outputs.cache-hit }} | |
| uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4 | |
| with: | |
| path: ${{ env.winfsp }} | |
| key: ${{ env.winfsp }} | |
| - name: Set Version | |
| id: get_version | |
| shell: bash | |
| run: echo "VERSION=${REF_NAME#v}" >> $GITHUB_OUTPUT | |
| env: | |
| REF_NAME: ${{ github.ref_name }} | |
| - name: Run Inno Setup | |
| # Build the installer and save it to actions/cache | |
| 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: | | |
| "C:/Program Files (x86)/Inno Setup 6/iscc.exe" windows_installer_build.iss | |
| - 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@0400d5f644dc74513175e3cd8d07132dd4860809 # 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.25" | |
| zig: 0.15.1 | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| # libfuse-dev is required to build our command-line program and enable GoReleaser to build for ARM64 | |
| - name: Install Libfuse | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-aarch64-linux-gnu libfuse-dev | |
| # Get code and Go ready | |
| - name: Checkout code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Install Zig | |
| env: | |
| ZIG: ${{ env.zig }} | |
| run: | | |
| curl -L https://ziglang.org/download/${ZIG}/zig-x86_64-linux-${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-x86_64-linux-${ZIG}" >> $GITHUB_PATH | |
| rm zig.tar.xz | |
| - name: Install Go | |
| uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 | |
| with: | |
| go-version: ${{ env.go }} | |
| check-latest: true | |
| cache: false | |
| - name: Set up Cosign | |
| uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2 | |
| - name: Set Version | |
| id: get_version | |
| run: echo "VERSION=${REF_NAME#v}" >> $GITHUB_OUTPUT | |
| env: | |
| REF_NAME: ${{ github.ref_name }} | |
| # Get cached intermediate build products | |
| - name: Restore cached Windows installer | |
| uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # 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 | |
| # Run GoReleaser (see .goreleaser.yaml) | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6 | |
| with: | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| update-package-repos: | |
| name: Update APT & RPM Repositories | |
| needs: release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Install dependencies | |
| run: sudo apt-get update && sudo apt-get install -y createrepo-c | |
| - name: Checkout gh-pages branch | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| ref: gh-pages | |
| path: gh-pages | |
| persist-credentials: true | |
| - name: Download .deb and .rpm packages from release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| TAG: ${{ github.ref_name }} | |
| run: | | |
| mkdir ./packages | |
| gh release download $TAG --dir ./packages -p "*.deb" | |
| gh release download $TAG --dir ./packages -p "*.rpm" | |
| - name: Import GPG key | |
| id: import_gpg | |
| uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec # v6.3.0 | |
| with: | |
| gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
| - name: Update APT repository | |
| working-directory: ./gh-pages | |
| run: | | |
| # Move new .deb files into the repository | |
| find ../packages -name "*_amd64.deb" -exec mv {} dists/stable/main/binary-amd64/ \; | |
| find ../packages -name "*_arm64.deb" -exec mv {} dists/stable/main/binary-arm64/ \; | |
| # Generate Packages metadata | |
| apt-ftparchive packages dists/stable/main/binary-amd64 > dists/stable/main/binary-amd64/Packages | |
| gzip -k -f dists/stable/main/binary-amd64/Packages | |
| apt-ftparchive packages dists/stable/main/binary-arm64 > dists/stable/main/binary-arm64/Packages | |
| gzip -k -f dists/stable/main/binary-arm64/Packages | |
| # Generate and sign the Release file | |
| apt-ftparchive \ | |
| -o APT::FTPArchive::Release::Origin="Seagate Technology" \ | |
| -o APT::FTPArchive::Release::Label="cloudfuse" \ | |
| -o APT::FTPArchive::Release::Suite="stable" \ | |
| -o APT::FTPArchive::Release::Codename="stable" \ | |
| -o APT::FTPArchive::Release::Architectures="amd64 arm64" \ | |
| -o APT::FTPArchive::Release::Components="main" \ | |
| -o APT::FTPArchive::Release::Description="APT repository for cloudfuse" \ | |
| release dists/stable > dists/stable/Release | |
| gpg --clearsign -u "${STEPS_IMPORT_GPG_OUTPUTS_FINGERPRINT}" --batch --pinentry-mode loopback --passphrase "${SECRET_GPG_PASSPHRASE}" -o dists/stable/InRelease dists/stable/Release | |
| gpg -u "${STEPS_IMPORT_GPG_OUTPUTS_FINGERPRINT}" --batch --pinentry-mode loopback --passphrase "${SECRET_GPG_PASSPHRASE}" -abs -o dists/stable/Release.gpg dists/stable/Release | |
| env: | |
| STEPS_IMPORT_GPG_OUTPUTS_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | |
| SECRET_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| - name: Update RPM repository | |
| working-directory: ./gh-pages | |
| run: | | |
| # Move new .rpm files | |
| find ../packages -name "*.rpm" -exec mv {} rpm-repo/ \; | |
| # Create/update repository metadata | |
| createrepo_c --database rpm-repo/ | |
| # Sign the repository metadata | |
| gpg --detach-sign --armor -u "${STEPS_IMPORT_GPG_OUTPUTS_FINGERPRINT}" --batch --pinentry-mode loopback --passphrase "${SECRET_GPG_PASSPHRASE}" rpm/repodata/repomd.xml | |
| env: | |
| STEPS_IMPORT_GPG_OUTPUTS_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | |
| SECRET_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| - name: Commit and push repository updates | |
| working-directory: ./gh-pages | |
| env: | |
| GITHUB_REF_NAME: ${{ github.ref_name }} | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add . | |
| if git diff-index --quiet HEAD; then | |
| echo "No changes to commit." | |
| else | |
| git commit -m "Update APT & RPM repositories for release ${GITHUB_REF_NAME}" | |
| git push | |
| fi |