Skip to content

ci(build): update permissions for workflow #34

ci(build): update permissions for workflow

ci(build): update permissions for workflow #34

Workflow file for this run

name: Build
on:
push:
branches: [main, dev]
paths-ignore:
- "**/*.md"
jobs:
build:
name: Build and release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install pnpm and dependencies
run: |
npm i -g pnpm
pnpm i
- name: Build
run: pnpm build --release-branch=${{ github.ref_name }} --build-minify
# TODO: Check for linting?
- name: Get file hash
id: hash
run: echo "hash=$GITHUB_SHA" >> "$GITHUB_OUTPUT"
- name: Create draft release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.hash.outputs.hash }}
release_name: Revenge ${{ steps.hash.outputs.hash }}
draft: true
prerelease: false
- name: Upload dist
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/revenge.js
asset_name: revenge.js
asset_content_type: text/javascript
- name: Publish release
uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}