release #5
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 | |
| on: | |
| release: | |
| types: [ published ] | |
| jobs: | |
| prepare_release: | |
| name: Prepare Release | |
| runs-on: ubuntu-latest | |
| outputs: | |
| web_version: ${{ steps.web.outputs.version }} | |
| built_at: ${{ steps.metadata.outputs.built_at }} | |
| steps: | |
| - name: Prerelease | |
| uses: irongut/EditRelease@v1.2.0 | |
| with: | |
| token: ${{ secrets.MY_TOKEN }} | |
| id: ${{ github.event.release.id }} | |
| prerelease: true | |
| - name: Resolve frontend version | |
| id: web | |
| run: | | |
| release_url=$(curl --fail --silent --show-error --location --head --retry 3 \ | |
| --output /dev/null --write-out '%{url_effective}' \ | |
| "https://github.com/AlliotTech/openalist-web/releases/latest") | |
| version="${release_url##*/}" | |
| if [ -z "$version" ]; then | |
| echo "Failed to resolve the latest frontend version" >&2 | |
| exit 1 | |
| fi | |
| echo "version=$version" >>"$GITHUB_OUTPUT" | |
| - name: Set build metadata | |
| id: metadata | |
| run: echo "built_at=$(date +'%F %T %z')" >>"$GITHUB_OUTPUT" | |
| build_xgo: | |
| needs: prepare_release | |
| name: Build ${{ matrix.group }} | |
| runs-on: ubuntu-latest | |
| env: | |
| WEB_VERSION: ${{ needs.prepare_release.outputs.web_version }} | |
| BUILT_AT: ${{ needs.prepare_release.outputs.built_at }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| group: | |
| - xgo-linux-core | |
| - xgo-linux-arm | |
| - xgo-linux-mips | |
| - xgo-linux-other | |
| - xgo-desktop | |
| steps: | |
| - name: Free Disk Space (Ubuntu) | |
| uses: jlumbroso/free-disk-space@v1.3.1 | |
| with: | |
| tool-cache: false | |
| android: true | |
| dotnet: true | |
| haskell: true | |
| large-packages: true | |
| docker-images: true | |
| swap-storage: true | |
| - name: Checkout | |
| uses: actions/checkout@v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Go | |
| uses: actions/setup-go@v7.0.0 | |
| with: | |
| go-version-file: go.mod | |
| - name: Install dependencies | |
| run: | | |
| sudo snap install zig --classic --beta | |
| docker pull ghcr.io/crazy-max/xgo:latest | |
| go install github.com/crazy-max/xgo@latest | |
| - name: Install UPX | |
| if: matrix.group == 'xgo-linux-core' || matrix.group == 'xgo-desktop' | |
| run: sudo apt install upx | |
| - name: Build | |
| run: bash build.sh release "${{ matrix.group }}" | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v7.0.1 | |
| with: | |
| name: release-${{ matrix.group }} | |
| path: build/compress/* | |
| if-no-files-found: error | |
| retention-days: 1 | |
| compression-level: 0 | |
| build_windows_arm64: | |
| needs: prepare_release | |
| name: Build windows-arm64 | |
| runs-on: ubuntu-latest | |
| env: | |
| WEB_VERSION: ${{ needs.prepare_release.outputs.web_version }} | |
| BUILT_AT: ${{ needs.prepare_release.outputs.built_at }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Go | |
| uses: actions/setup-go@v7.0.0 | |
| with: | |
| go-version-file: go.mod | |
| - name: Install Zig | |
| run: sudo snap install zig --classic --beta | |
| - name: Build | |
| run: bash build.sh release windows_arm64 | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v7.0.1 | |
| with: | |
| name: release-windows-arm64 | |
| path: build/compress/* | |
| if-no-files-found: error | |
| retention-days: 1 | |
| compression-level: 0 | |
| release: | |
| needs: | |
| - build_xgo | |
| - build_windows_arm64 | |
| name: Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7.0.1 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v8.0.1 | |
| with: | |
| pattern: release-* | |
| path: build/compress | |
| merge-multiple: true | |
| - name: Verify assets | |
| run: bash build.sh finalize | |
| - name: Upload assets | |
| uses: softprops/action-gh-release@v3.0.2 | |
| with: | |
| files: build/compress/* | |
| prerelease: false |