release #17
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: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 6 | |
matrix: | |
node-version: [18] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
# Enable conversion to PDF | |
- run: sudo sed -i 's/policy domain="coder" rights="none" pattern="PDF"/policy domain="coder" rights="read | write" pattern="PDF"'/ /etc/ImageMagick-6/policy.xml | |
# Install packages and build | |
- run: npm clean-install . | |
- run: npm run lint | |
- run: npm run test | |
- run: npm run build | |
- run: ./makedeb.sh | |
# We may need the package name for a release later (if not the dev branch and it's node 12) | |
- name: Retrieve package name | |
run: | | |
echo "PACKAGE_NAME=$(ls ./debian/ | grep .*\.deb)" >> $GITHUB_ENV | |
# Create a draft release with asset if there's a package | |
- name: Create Release | |
id: create_release | |
if: env.PACKAGE_NAME | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
files: ./debian/${{ env.PACKAGE_NAME }} | |
name: Release ${{ github.ref }} | |
prerelease: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag_name: ${{ github.ref }} |