-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from klemola/package-exe
Set up binaries for releases
- Loading branch information
Showing
6 changed files
with
1,606 additions
and
1 deletion.
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,57 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.**" | ||
|
||
jobs: | ||
package: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Set env | ||
run: | | ||
echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:10}) | ||
echo ::set-env name=ARCHIVE_NAME::$(echo "foobar2000-web-ui-${GITHUB_REF:10}.tar.gz") | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: "12.x" | ||
|
||
- name: Build | ||
run: | | ||
yarn | ||
yarn build | ||
- name: Package | ||
id: package | ||
run: | | ||
cd ./release | ||
yarn | ||
yarn package | ||
tar -czf dist/${{ env.ARCHIVE_NAME }} dist/foobar2000-web-ui.exe | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1.0.0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ env.RELEASE_VERSION }} | ||
release_name: Release ${{ env.RELEASE_VERSION }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1.0.1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: "./release/dist/${{ env.ARCHIVE_NAME }}" | ||
asset_name: ${{ env.ARCHIVE_NAME }} | ||
asset_content_type: application/zip |
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ npm-debug.log | |
.DS_Store | ||
.vscode | ||
build/ | ||
dist/ |
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,10 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const { exec } = require('pkg') | ||
|
||
const SERVER_ENTRYPOINT = '../build/main.js' | ||
const TARGET = 'node12-win-x64' | ||
const PKG_OUTPUT = './dist/foobar2000-web-ui.exe' | ||
|
||
exec([SERVER_ENTRYPOINT, '--target', TARGET, '--output', PKG_OUTPUT]) | ||
.then(() => console.info('✅ .exe built!')) | ||
.catch(console.error) |
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,11 @@ | ||
{ | ||
"name": "foobar2000-web-ui-release", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"scripts": { | ||
"package": "node index.js" | ||
}, | ||
"dependencies": { | ||
"pkg": "4.4.0" | ||
} | ||
} |
Oops, something went wrong.