Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Artifact script fix #1464

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 24 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,29 @@ name: Artifact

on:
push:
branches: [ master, 'Release-*' ]
tags: [ 'v*' ]
release:
types: [released]
# Triggers the workflow only when merging pull request to the branches.
pull_request:
types: [closed]
branches: [ master, 'Release-*' ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

inputs:
version:
description: 'Release version'
required: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Cache node_modules
uses: actions/cache@v2
uses: actions/cache@v4
id: cache-npm-packages
with:
path: node_modules
Expand All @@ -37,7 +35,7 @@ jobs:
run: npm ci --legacy-peer-deps

- name: Cache build frontend
uses: actions/cache@v2
uses: actions/cache@v4
id: cache-build-frontend
with:
path: frontend
Expand All @@ -47,7 +45,7 @@ jobs:
run: npm run buildfrontend

- name: Cache build backend
uses: actions/cache@v2
uses: actions/cache@v4
id: cache-build-backend
with:
path: backend
Expand All @@ -61,26 +59,32 @@ jobs:
needs: build
steps:
- name: Checkout source code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Cache build frontend
uses: actions/cache@v2
uses: actions/cache@v4
id: cache-build-frontend
with:
path: frontend
key: ${{ runner.os }}-frontend-${{ github.sha }}

- name: Cache build backend
uses: actions/cache@v2
uses: actions/cache@v4
id: cache-build-backend
with:
path: backend
key: ${{ runner.os }}-backend-${{ github.sha }}

- name: Compress files
run: tar -czf /tmp/rtlbuild.tar.gz frontend backend rtl.js package.json package-lock.json

- uses: actions/upload-artifact@v2
env:
VERSION: "${{ github.event.release.tag_name || github.event.inputs.version || '' }}"
run: |
tar -czf /tmp/rtl-build-$VERSION.tar.gz frontend backend rtl.js package.json package-lock.json
zip -r /tmp/rtl-build-$VERSION.zip frontend backend rtl.js package.json package-lock.json

- uses: actions/upload-artifact@v3
with:
name: rtl-build-${{ github.event.release.tag_name }}
path: /tmp/rtlbuild.tar.gz
name: rtl-build-${{ github.event.release.tag_name || github.event.inputs.version || '' }}
path: |
/tmp/rtl-build-${{ github.event.release.tag_name || github.event.inputs.version || '' }}.tar.gz
/tmp/rtl-build-${{ github.event.release.tag_name || github.event.inputs.version || '' }}.zip
Loading