2023-06-25 04:49:23 +00:00
|
|
|
name: Build/Publish
|
|
|
|
|
|
|
|
on:
|
2023-06-25 05:00:39 +00:00
|
|
|
workflow_call:
|
2023-06-25 04:49:23 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Use Node.js
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 18.x
|
|
|
|
cache: 'npm'
|
|
|
|
- run: npm ci
|
|
|
|
- run: npm run build --if-present
|
2023-06-25 06:59:49 +00:00
|
|
|
- name: Archive Release
|
|
|
|
uses: thedoctor0/zip-release@0.7.1
|
|
|
|
with:
|
|
|
|
type: tar
|
|
|
|
filename: build.tar.gz
|
|
|
|
exclusions: "*.git*"
|
2023-06-25 05:44:46 +00:00
|
|
|
- name: Cache build
|
2023-06-25 06:49:12 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2023-06-25 04:49:23 +00:00
|
|
|
with:
|
2023-06-25 06:49:12 +00:00
|
|
|
name: cache-${{ github.run_id }}-${{ github.run_attempt }}
|
2023-06-25 06:59:49 +00:00
|
|
|
path: build.tar.gz
|
2023-06-25 04:49:23 +00:00
|
|
|
publish:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
|
|
|
steps:
|
2023-06-25 06:59:49 +00:00
|
|
|
- name: Fetch build cache
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: cache-${{ github.run_id }}-${{ github.run_attempt }}
|
|
|
|
- name: Extract build cache
|
|
|
|
run: tar xvf build.tar.gz && rm build.tar.gz -f
|
2023-06-25 04:49:23 +00:00
|
|
|
- name: Install SSH key
|
|
|
|
uses: shimataro/ssh-key-action@v2
|
|
|
|
with:
|
|
|
|
key: ${{ secrets.GITEA_SSH_KEY }}
|
|
|
|
name: gitea # optional
|
|
|
|
known_hosts: ${{ secrets.GITEA_KNOWN_HOST }}
|
2023-06-25 06:59:49 +00:00
|
|
|
- run: npm run semantic-release
|