From 51f0ba6ee2af0e1de09651f25c0f7c5b50a6c6bc Mon Sep 17 00:00:00 2001 From: Aram Akhavan Date: Fri, 6 Feb 2026 16:20:57 -0800 Subject: [PATCH] Update release workflows (#874) * Bump action versions * Merge frontend release into main release workflow * Fix bugs with asset naming --- .github/workflows/release-frontend.yaml | 34 ---------------- .github/workflows/release.yaml | 54 +++++++++++++++++++------ 2 files changed, 42 insertions(+), 46 deletions(-) delete mode 100644 .github/workflows/release-frontend.yaml diff --git a/.github/workflows/release-frontend.yaml b/.github/workflows/release-frontend.yaml deleted file mode 100644 index 24d0b15..0000000 --- a/.github/workflows/release-frontend.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# compiles angular frontend and attaches it to the latest release. -name: Release Frontend - -on: - release: - # Only use the types keyword to narrow down the activity types that will trigger your workflow. - types: [published] -jobs: - release-frontend: - name: Release Frontend - runs-on: ubuntu-latest - container: node:lts-slim - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - ref: ${{github.event.release.tag_name}} - - name: "Generate frontend version information" - run: "cd webapp/frontend && ./git.version.sh" - - name: Build Frontend - run: | - apt-get update && apt-get install -y make - make binary-frontend - tar -czf scrutiny-web-frontend.tar.gz dist - - name: Upload Frontend Asset - id: upload-release-asset3 - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.SCRUTINY_GITHUB_TOKEN }} - with: - upload_url: ${{ github.event.release.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: './scrutiny-web-frontend.tar.gz' - asset_name: scrutiny-web-frontend.tar.gz - asset_content_type: application/gzip diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 27542fa..146751f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -39,7 +39,7 @@ jobs: add-apt-repository ppa:git-core/ppa && apt-get update && apt-get install -y git git --version - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v6 with: fetch-depth: 0 - name: Bump version @@ -91,37 +91,66 @@ jobs: - { on: windows-latest, goos: windows, goarch: arm64 } steps: - name: Download workspace - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v7 with: name: workspace - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v6 with: go-version: '1.20.1' # The Go version to download (if necessary) and use. - name: Build Binaries run: | make binary-clean binary-all - - name: Archive - uses: actions/upload-artifact@v4 + - name: Upload artifacts + uses: actions/upload-artifact@v6 with: - name: scrutiny-${{ matrix.cfg.goos }}-${{ matrix.cfg.goarch }}${{ matrix.cfg.goarm && '-' }}${{ matrix.cfg.goarm || '' }}.zip + name: scrutiny-${{ matrix.cfg.goos }}-${{ matrix.cfg.goarch }}${{ case(matrix.cfg.goarm != '', format('-{0}', matrix.cfg.goarm), '') }}.zip path: | - scrutiny-web-${{ matrix.cfg.goos }}-${{ matrix.cfg.goarch }}${{ matrix.cfg.goarm && '-' }}${{ matrix.cfg.goarm || '' }}${{ matrix.cfg.goos == 'windows' && '.exe' }} - scrutiny-collector-metrics-${{ matrix.cfg.goos }}-${{ matrix.cfg.goarch }}${{ matrix.cfg.goarm && '-' }}${{ matrix.cfg.goarm || '' }}${{ matrix.cfg.goos == 'windows' && '.exe' }} + scrutiny-web-${{ matrix.cfg.goos }}-${{ matrix.cfg.goarch }}${{ case(matrix.cfg.goarm != '', format('-{0}', matrix.cfg.goarm), '') }}${{ case(matrix.cfg.goos == 'windows', '.exe', '') }} + scrutiny-collector-metrics-${{ matrix.cfg.goos }}-${{ matrix.cfg.goarch }}${{ case(matrix.cfg.goarm != '', format('-{0}', matrix.cfg.goarm), '') }}${{ case(matrix.cfg.goos == 'windows', '.exe', '') }} + + build_frontend: + name: Build Frontend + needs: release + runs-on: ubuntu-latest + container: node:lts-slim + steps: + - name: Download workspace + uses: actions/download-artifact@v7 + with: + name: workspace + - name: "Generate frontend version information" + run: "cd webapp/frontend && chmod +x git.version.sh && ./git.version.sh" + - name: Build Frontend + run: | + apt-get update && apt-get install -y make + make binary-frontend + tar -czf scrutiny-web-frontend.tar.gz dist + - name: Upload artifacts + uses: actions/upload-artifact@v6 + with: + name: scrutiny-web-frontend.zip + path: scrutiny-web-frontend.tar.gz release-publish: name: Publish Release - needs: build + needs: + - build + - build_frontend runs-on: ubuntu-latest steps: - name: Download workspace - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v7 with: name: workspace - name: Download binaries - uses: actions/download-artifact@v5 + uses: actions/download-artifact@v7 with: - merge_multiple: true + merge-multiple: true pattern: scrutiny-*.zip + - name: Download frontend + uses: actions/download-artifact@v7 + with: + name: scrutiny-web-frontend.zip - name: List shell: bash run: | @@ -145,6 +174,7 @@ jobs: scrutiny-collector-metrics-linux-arm64 scrutiny-collector-metrics-windows-amd64.exe scrutiny-collector-metrics-windows-arm64.exe + scrutiny-web-frontend.tar.gz scrutiny-web-darwin-amd64 scrutiny-web-darwin-arm64 scrutiny-web-freebsd-amd64