new version with go (#131) #88
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 | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "plugin.yaml" | |
permissions: | |
contents: write # For report_template.html creation | |
id-token: write # For cosign | |
jobs: | |
check-version: | |
uses: fatihtokus/scan2html/.github/workflows/check-version.yml@main | |
build-front-end: | |
name: "Build front-end application" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
needs: check-version | |
if: ${{ needs.check-version.outputs.next-version != '' }} | |
env: | |
reportTemplate: 'report_template.html' | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0 | |
with: | |
egress-policy: audit | |
- name: Checkout repo | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | |
- name: Setup Node | |
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2 | |
with: | |
working-directory: src/frontend-app | |
- name: Install dependencies | |
uses: bahmutov/npm-install@e5c7e14408aa6089501de32bd16123b41738047e # v1.10.2 | |
with: | |
working-directory: src/frontend-app | |
- name: Build frontend project | |
run: | | |
cd src/frontend-app/ | |
npm run build | |
- name: Preparing report_template.html | |
run: | | |
# copy js files | |
cat | |
{ | |
# copy report file except for the last 4 lines | |
head -n -4 'src/frontend-app/dist/src/assets/app-template.html' | |
echo '' | |
cat 'src/frontend-app/dist/app.js' | |
echo '' | |
echo '</script>' | |
echo '</body>' | |
echo '</html>' | |
} >"$reportTemplate" | |
cat "$reportTemplate" | |
- name: Upload report_template.html | |
uses: actions/upload-artifact@v3 | |
with: | |
name: report-template | |
path: ${{ env.reportTemplate }} | |
release: | |
needs: | |
- check-version | |
- build-front-end | |
uses: fatihtokus/scan2html/.github/workflows/release-go.yml@main | |
with: | |
next-version: '${{ needs.check-version.outputs.next-version }}' |