Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kikijiki committed Dec 14, 2024
1 parent 0c643e5 commit f3dcba8
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 18 deletions.
34 changes: 16 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
name: Build

on:
push:
branches: [ master ]
tags:
- 'v*'
pull_request:
branches: [ master ]
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Upload main.js
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./main.js
asset_name: main.js
asset_content_type: application/javascript

- name: Upload manifest.json
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./manifest.json
asset_name: manifest.json
asset_content_type: application/json

- name: Upload styles.css
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./styles.css
asset_name: styles.css
asset_content_type: text/css
continue-on-error: true # Skip if styles.css doesn't exist

0 comments on commit f3dcba8

Please sign in to comment.