Update release workflows (#874)

* Bump action versions
* Merge frontend release into main release workflow
* Fix bugs with asset naming
This commit is contained in:
Aram Akhavan
2026-02-06 16:20:57 -08:00
committed by GitHub
parent 34b0347acd
commit 51f0ba6ee2
2 changed files with 42 additions and 46 deletions
-34
View File
@@ -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
+42 -12
View File
@@ -39,7 +39,7 @@ jobs:
add-apt-repository ppa:git-core/ppa && apt-get update && apt-get install -y git add-apt-repository ppa:git-core/ppa && apt-get update && apt-get install -y git
git --version git --version
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v6
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Bump version - name: Bump version
@@ -91,37 +91,66 @@ jobs:
- { on: windows-latest, goos: windows, goarch: arm64 } - { on: windows-latest, goos: windows, goarch: arm64 }
steps: steps:
- name: Download workspace - name: Download workspace
uses: actions/download-artifact@v4 uses: actions/download-artifact@v7
with: with:
name: workspace name: workspace
- uses: actions/setup-go@v3 - uses: actions/setup-go@v6
with: with:
go-version: '1.20.1' # The Go version to download (if necessary) and use. go-version: '1.20.1' # The Go version to download (if necessary) and use.
- name: Build Binaries - name: Build Binaries
run: | run: |
make binary-clean binary-all make binary-clean binary-all
- name: Archive - name: Upload artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v6
with: 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: | path: |
scrutiny-web-${{ 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 }}${{ matrix.cfg.goarm && '-' }}${{ matrix.cfg.goarm || '' }}${{ 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: release-publish:
name: Publish Release name: Publish Release
needs: build needs:
- build
- build_frontend
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Download workspace - name: Download workspace
uses: actions/download-artifact@v4 uses: actions/download-artifact@v7
with: with:
name: workspace name: workspace
- name: Download binaries - name: Download binaries
uses: actions/download-artifact@v5 uses: actions/download-artifact@v7
with: with:
merge_multiple: true merge-multiple: true
pattern: scrutiny-*.zip pattern: scrutiny-*.zip
- name: Download frontend
uses: actions/download-artifact@v7
with:
name: scrutiny-web-frontend.zip
- name: List - name: List
shell: bash shell: bash
run: | run: |
@@ -145,6 +174,7 @@ jobs:
scrutiny-collector-metrics-linux-arm64 scrutiny-collector-metrics-linux-arm64
scrutiny-collector-metrics-windows-amd64.exe scrutiny-collector-metrics-windows-amd64.exe
scrutiny-collector-metrics-windows-arm64.exe scrutiny-collector-metrics-windows-arm64.exe
scrutiny-web-frontend.tar.gz
scrutiny-web-darwin-amd64 scrutiny-web-darwin-amd64
scrutiny-web-darwin-arm64 scrutiny-web-darwin-arm64
scrutiny-web-freebsd-amd64 scrutiny-web-freebsd-amd64