38 lines
983 B
YAML
38 lines
983 B
YAML
name: Release Job
|
|
run-name: ${{gitea.actor}} is releasing a package
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: node-01
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: '14' # Specify the Node.js version you need
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
- name: Run tests
|
|
run: npm test
|
|
|
|
- name: Build project
|
|
run: npm run build
|
|
|
|
- name: Package build output
|
|
run: |
|
|
cd ./dist
|
|
zip -r ../release.zip . # Adjust the path to your build output directory
|
|
|
|
- name: Upload release asset
|
|
run: |
|
|
curl -X PATCH -H "Content-Type: application/zip" \
|
|
--data-binary @release.zip \
|
|
"${{ .GITEA_API_URL }}/repos/${{ .GITEA_REPO_OWNER }}/${{ .GITEA_REPO_NAME }}/releases/${{ .GITEA_RELEASE_ID }}/assets?name=release.zip"
|