This repository was archived by the owner on Mar 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bring Github actions to 5.2 branch (#105)
* Added dev and prod configs to webpack (#102) * Adding github actions to create an NPM package for frontend library and make a release for the repo (#103) * Added workflow file for pushing library to npm * Added workflow file for making a release with built implementation/EpicGames archives
- Loading branch information
Showing
12 changed files
with
253 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Publish the Signalling Server container image from our dev branch | ||
|
||
on: | ||
push: | ||
branches: ['UE5.2'] | ||
paths: ['SignallingWebServer/**'] | ||
|
||
jobs: | ||
signalling-server-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
- | ||
name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- | ||
name: Build and push the Signalling Server container image for Unreal Engine based on our development branch | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./SignallingWebServer | ||
tags: 'ghcr.io/epicgames/pixel-streaming-signalling-server:dev' | ||
push: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Releases | ||
|
||
on: | ||
push: | ||
branches: ['UE5.2'] | ||
paths: ['RELEASE_VERSION'] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./ | ||
|
||
permissions: | ||
contents: write | ||
steps: | ||
- name: "Checkout source code" | ||
uses: actions/checkout@v3 | ||
|
||
- name: Read the RELEASE_VERSION file | ||
id: getversion | ||
run: echo "version=$(cat RELEASE_VERSION)" >> $GITHUB_OUTPUT | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Install library deps | ||
working-directory: ./Frontend/library | ||
run: npm ci | ||
|
||
- name: Build frontend lib | ||
working-directory: ./Frontend/library | ||
run: npm run build | ||
|
||
- name: Install implementations/EpicGames deps | ||
working-directory: ./Frontend/implementations/EpicGames | ||
run: npm ci | ||
|
||
- name: Build implementations/EpicGames | ||
working-directory: ./Frontend/implementations/EpicGames | ||
run: npm run build-all | ||
|
||
- name: Make output directory for archives | ||
run: mkdir output | ||
|
||
- name: Archive Release tar.gz | ||
uses: thedoctor0/[email protected] | ||
with: | ||
directory: './output' | ||
path: '../' | ||
type: 'tar' | ||
filename: '${{ github.ref_name }}-${{ steps.getversion.outputs.version }}.tar.gz' | ||
exclusions: '.git .github output Frontend/Docs Frontend/library/dist Frontend/library/types Frontend/library/node_modules Frontend/implementations/EpicGames/node_modules' | ||
|
||
- name: Archive Release tar.gz | ||
uses: thedoctor0/[email protected] | ||
with: | ||
directory: './output' | ||
path: '../' | ||
type: 'zip' | ||
filename: '${{ github.ref_name }}-${{ steps.getversion.outputs.version }}.zip' | ||
exclusions: '*.git* /*node_modules/* .editorconfig /*types/* /*dist/* /*output/* /*Docs/*' | ||
|
||
- name: "Make the release" | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: "${{ github.ref_name }}-${{ steps.getversion.outputs.version }}" | ||
artifacts: "output/${{ github.ref_name }}-${{ steps.getversion.outputs.version }}.zip,output/${{ github.ref_name }}-${{ steps.getversion.outputs.version }}.tar.gz" | ||
generateReleaseNotes: true |
6 changes: 3 additions & 3 deletions
6
Frontend/.github/workflows/release.yml → .github/workflows/publish-library-to-npm.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
160 changes: 75 additions & 85 deletions
160
...plementations/EpicGames/webpack.config.js → ...plementations/EpicGames/webpack.common.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,75 @@ | ||
// Copyright Epic Games, Inc. All Rights Reserved. | ||
|
||
const path = require('path'); | ||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
const webpack = require('webpack'); | ||
const fs = require('fs'); | ||
|
||
const pages = fs.readdirSync('./src', { withFileTypes: true }) | ||
.filter(item => !item.isDirectory()) | ||
.filter(item => path.parse(item.name).ext === '.html') | ||
.map(htmlFile => path.parse(htmlFile.name).name); | ||
|
||
module.exports = (env) => { | ||
return { | ||
mode: 'development', | ||
entry: pages.reduce((config, page) => { | ||
config[page] = `./src/${page}.ts`; | ||
return config; | ||
}, {}), | ||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
WEBSOCKET_URL: JSON.stringify((env.WEBSOCKET_URL !== undefined) ? env.WEBSOCKET_URL : '') | ||
}), | ||
].concat(pages.map((page) => new HtmlWebpackPlugin({ | ||
title: 'Development', | ||
template: `./src/${page}.html`, | ||
filename: `${page}.html`, | ||
chunks: [page], | ||
}), )), | ||
// turn off so we can see the source map for dom delegate so we can debug the library | ||
devtool: 'inline-source-map', | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.tsx?$/, | ||
loader: 'ts-loader', | ||
exclude: [ | ||
/node_modules/, | ||
], | ||
}, | ||
{ | ||
test: /\.html$/i, | ||
use: 'html-loader' | ||
}, | ||
{ | ||
test: /\.css$/, | ||
type: 'asset/resource', | ||
generator: { | ||
filename: 'css/[name][ext]' | ||
} | ||
}, | ||
{ | ||
test: /\.(png|svg)$/i, | ||
type: 'asset/resource', | ||
generator: { | ||
filename: 'images/[name][ext]' | ||
} | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
extensions: ['.tsx', '.ts', '.js', '.svg'], | ||
}, | ||
output: { | ||
filename: '[name].js', | ||
library: 'frontend', // change this to something more meaningful | ||
libraryTarget: 'umd', | ||
path: path.resolve(__dirname, '../../../SignallingWebServer/Public'), | ||
clean: true, | ||
globalObject: 'this', | ||
hashFunction: 'xxhash64', | ||
}, | ||
experiments: { | ||
futureDefaults: true | ||
}, | ||
optimization: { | ||
minimize: false | ||
}, | ||
devServer: { | ||
static: { | ||
directory: path.join(__dirname, '../../../SignallingWebServer/Public'), | ||
}, | ||
} | ||
}; | ||
} | ||
// Copyright Epic Games, Inc. All Rights Reserved. | ||
|
||
const path = require('path'); | ||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
const webpack = require('webpack'); | ||
const fs = require('fs'); | ||
|
||
const pages = fs.readdirSync('./src', { withFileTypes: true }) | ||
.filter(item => !item.isDirectory()) | ||
.filter(item => path.parse(item.name).ext === '.html') | ||
.map(htmlFile => path.parse(htmlFile.name).name); | ||
|
||
module.exports = { | ||
entry: pages.reduce((config, page) => { | ||
config[page] = `./src/${page}.ts`; | ||
return config; | ||
}, {}), | ||
|
||
plugins: [].concat(pages.map((page) => new HtmlWebpackPlugin({ | ||
title: `${page}`, | ||
template: `./src/${page}.html`, | ||
filename: `${page}.html`, | ||
chunks: [page], | ||
}), )), | ||
|
||
module: { | ||
rules: [ | ||
{ | ||
test: /\.tsx?$/, | ||
loader: 'ts-loader', | ||
exclude: [ | ||
/node_modules/, | ||
], | ||
}, | ||
{ | ||
test: /\.html$/i, | ||
use: 'html-loader' | ||
}, | ||
{ | ||
test: /\.css$/, | ||
type: 'asset/resource', | ||
generator: { | ||
filename: 'css/[name][ext]' | ||
} | ||
}, | ||
{ | ||
test: /\.(png|svg)$/i, | ||
type: 'asset/resource', | ||
generator: { | ||
filename: 'images/[name][ext]' | ||
} | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
extensions: ['.tsx', '.ts', '.js', '.svg', '.json'], | ||
}, | ||
output: { | ||
filename: '[name].js', | ||
library: 'epicgames-frontend', | ||
libraryTarget: 'umd', | ||
path: path.resolve(__dirname, '../../../SignallingWebServer/Public'), | ||
clean: true, | ||
globalObject: 'this', | ||
hashFunction: 'xxhash64', | ||
}, | ||
experiments: { | ||
futureDefaults: true | ||
}, | ||
devServer: { | ||
static: { | ||
directory: path.join(__dirname, '../../../SignallingWebServer/Public'), | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright Epic Games, Inc. All Rights Reserved. | ||
|
||
const { merge } = require('webpack-merge'); | ||
const common = require('./webpack.common.js'); | ||
const path = require('path'); | ||
|
||
module.exports = merge(common, { | ||
mode: 'development', | ||
devtool: 'inline-source-map', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright Epic Games, Inc. All Rights Reserved. | ||
|
||
const { merge } = require('webpack-merge'); | ||
const common = require('./webpack.common.js'); | ||
|
||
module.exports = merge(common, { | ||
mode: 'production', | ||
optimization: { | ||
usedExports: true, | ||
minimize: true | ||
}, | ||
stats: 'errors-only', | ||
performance: { | ||
hints: false | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright Epic Games, Inc. All Rights Reserved. | ||
|
||
const { merge } = require('webpack-merge'); | ||
const common = require('./webpack.common.js'); | ||
|
||
module.exports = merge(common, { | ||
mode: 'development', | ||
devtool: 'inline-source-map', | ||
devServer: { | ||
static: './dist', | ||
}, | ||
output: { | ||
filename: 'lib-pixelstreamingfrontend.js', | ||
} | ||
}); |
Oops, something went wrong.