Update release-candidate.yml #12
Workflow file for this run
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: | |
tags: | |
- "rc*" | |
permissions: # added using https://github.com/step-security/secure-workflows | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
env: | |
reportTemplate: 'report_template.html' | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
working-directory: src/frontend-app | |
- name: Install dependencies | |
uses: bahmutov/npm-install@v1 | |
with: | |
working-directory: src/frontend-app | |
- name: Build project | |
run: | | |
cd src/frontend-app/ | |
npm run build | |
- name: Preparing report_template.html | |
run: | | |
# copy js files | |
cat | |
{ | |
# copy report file except 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: Compress | |
run: tar -zcvf scan2html.tar.gz scan2html.sh "$reportTemplate" LICENSE results.json release-candidate/plugin.yaml | |
- name: Install GPG | |
run: sudo apt-get install -y gnupg | |
- name: Import GPG key | |
run: | | |
echo "$GPG_PRIVATE_KEY" | gpg --import | |
env: | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
- name: Sign the release file | |
run: | | |
echo "$GPG_PASSPHRASE" | gpg --batch --yes --passphrase-fd 0 --armor --detach-sign scan2html.tar.gz | |
env: | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
scan2html.tar.gz | |
scan2html.tar.gz.asc |