Skip to content

publish

publish #63

Workflow file for this run

name: publish
on: [push, pull_request]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: CS2Script
path: dist/code.user.js
release:
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
needs: publish
runs-on: ubuntu-latest
permissions:
contents: write
attestations: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1
- name: Download artifact
uses: actions/download-artifact@v4.1.7
with:
name: CS2Script
path: dist
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-path: 'dist/code.user.js'
- name: Create Github release
uses: ncipollo/release-action@v1.13.0
with:
artifacts: dist/code.user.js
name: CS2Script V${{ github.ref_name }}
tag: ${{ github.ref_name }}
bodyFile: .github/RELEASE_TEMPLATE.md
token: ${{ secrets.GITHUB_TOKEN }}
makeLatest: false
prerelease: true
draft: true