parent
ad372a6271
commit
d31085abf8
67
.github/workflows/ci.yaml
vendored
Normal file
67
.github/workflows/ci.yaml
vendored
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
name: ci
|
||||||
|
on: [ push, pull_request ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
statuses: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
|
||||||
|
- id: version
|
||||||
|
name: version
|
||||||
|
run: echo "VERSION=$(npm --silent run version)" >> ${GITHUB_OUTPUT}
|
||||||
|
|
||||||
|
- name: echo version
|
||||||
|
run: echo ${{ steps.version.outputs.VERSION }}
|
||||||
|
|
||||||
|
- name: npm install
|
||||||
|
run: npm install
|
||||||
|
- name: build
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: zip release
|
||||||
|
if: github.ref_name == 'main'
|
||||||
|
working-directory: dist
|
||||||
|
run: zip -r foundryvtt-dice-tower-${{ steps.version.outputs.VERSION }}.zip .
|
||||||
|
|
||||||
|
- name: create tag
|
||||||
|
if: github.ref_name == 'main'
|
||||||
|
run: |
|
||||||
|
git config user.email "ci@git.arindy.de"
|
||||||
|
git config user.name "gitea"
|
||||||
|
git tag ${{ steps.version.outputs.VERSION }} -m "release ${{ steps.version.outputs.VERSION }}"
|
||||||
|
git push origin main
|
||||||
|
git push origin ${{ steps.version.outputs.VERSION }}
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
id: create_release
|
||||||
|
if: github.ref_name == 'main'
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: ${{ steps.version.outputs.VERSION }}
|
||||||
|
release_name: Release ${{ steps.version.outputs.VERSION }}
|
||||||
|
|
||||||
|
- name: Upload Release Asset
|
||||||
|
id: upload-release-asset
|
||||||
|
if: github.ref_name == 'main'
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: dist/foundryvtt-dice-tower-${{ steps.version.outputs.VERSION }}.zip
|
||||||
|
asset_name: "Release ${{ steps.version.outputs.VERSION }}"
|
||||||
|
asset_content_type: application/zip
|
@ -8,6 +8,7 @@
|
|||||||
"build": "npm run clean && tsc && vite build",
|
"build": "npm run clean && tsc && vite build",
|
||||||
"watch": "tsc && vite build --watch",
|
"watch": "tsc && vite build --watch",
|
||||||
"copy": "sudo rsync -avP dist/ .foundry/data/Data/modules/dice-tower/",
|
"copy": "sudo rsync -avP dist/ .foundry/data/Data/modules/dice-tower/",
|
||||||
|
"version": "echo $npm_package_version",
|
||||||
"buildCopy": "npm run build && npm run copy"
|
"buildCopy": "npm run build && npm run copy"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user