1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-11 13:14:06 +01:00
server/.github/workflows/release.yml

103 lines
4.1 KiB
YAML
Raw Normal View History

2021-07-11 09:11:48 +02:00
on:
workflow_dispatch:
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
name: Publish Release
2021-07-10 19:01:53 +02:00
jobs:
2021-07-11 09:09:37 +02:00
insiders-build:
strategy:
matrix:
2021-07-11 09:11:48 +02:00
os: [windows, macos, ubuntu]
2021-07-11 09:09:37 +02:00
include:
- os: windows
2021-08-15 13:20:32 +02:00
build: npx caxa -i . -m 'This may take a while to run the first time, please wait...' --output 'fosscord-server-windows.exe' -- '{{caxa}}/node_modules/.bin/node' '{{caxa}}/dist/start.js'
2021-08-13 12:58:18 +02:00
artifact: fosscord-server-windows.exe
2021-07-11 09:09:37 +02:00
- os: macos
2021-08-15 13:20:32 +02:00
build: npx caxa -i . -m 'This may take a while to run the first time, please wait...' --output 'fosscord-server.app' -- '{{caxa}}/node_modules/.bin/node' '{{caxa}}/dist/start.js' && tar -czf 'fosscord-server-macos.app.tgz' 'fosscord-server.app'
2021-08-13 12:58:18 +02:00
artifact: fosscord-server-macos.app.tgz
2021-07-11 09:09:37 +02:00
- os: ubuntu
2021-08-15 13:20:32 +02:00
build: npx caxa -i . -m 'This may take a while to run the first time, please wait...' --output 'fosscord' -- '{{caxa}}/node_modules/.bin/node' '{{caxa}}/dist/start.js' && tar -czf 'fosscord-server-linux.tgz' 'fosscord'
2021-08-13 12:58:18 +02:00
artifact: fosscord-server-linux.tgz
2021-07-11 09:11:48 +02:00
runs-on: ${{ matrix.os }}-latest
2021-07-11 09:09:37 +02:00
steps:
- uses: actions/checkout@v2
2021-07-11 09:19:46 +02:00
- uses: actions/setup-node@v2
2021-07-11 09:09:37 +02:00
with:
node-version: 14
2021-08-15 13:20:32 +02:00
- run: cd bundle
2021-07-11 09:19:46 +02:00
- run: npm install
2021-08-15 13:20:32 +02:00
- run: npm i caxa
2021-08-13 12:58:18 +02:00
env:
MONGOMS_VERSION: 4.4.3
2021-07-11 09:19:46 +02:00
- run: npm run build
- run: ${{ matrix.build }}
2021-07-11 09:09:37 +02:00
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}
release:
needs: [insiders-build]
2021-07-10 19:01:53 +02:00
runs-on: ubuntu-latest
steps:
2021-07-11 10:11:18 +02:00
- uses: actions/checkout@v2
- name: Extract version
id: extract_version
uses: Saionaro/extract-package-version@v1.0.6
2021-08-15 13:23:04 +02:00
with:
path: api
2021-07-11 09:09:37 +02:00
- uses: actions/download-artifact@v2
with:
2021-08-13 12:58:18 +02:00
name: fosscord-server-windows.exe
2021-07-11 09:09:37 +02:00
- uses: actions/download-artifact@v2
with:
2021-08-13 12:58:18 +02:00
name: fosscord-server-macos.app.tgz
2021-07-11 10:01:27 +02:00
- uses: actions/download-artifact@v2
with:
2021-08-13 12:58:18 +02:00
name: fosscord-server-linux.tgz
2021-07-11 09:09:37 +02:00
- uses: actions/create-release@v1
id: create-release
2021-07-10 19:01:53 +02:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
2021-07-11 09:44:32 +02:00
tag_name: v${{ steps.extract_version.outputs.version }}
2021-08-13 12:58:18 +02:00
release_name: Server v${{ steps.extract_version.outputs.version }}
2021-07-16 16:16:10 +02:00
draft: false
2021-07-11 09:44:32 +02:00
prerelease: true # TODO: change this to false
2021-08-13 12:58:18 +02:00
body: >
## Download
- [Windows](https://github.com/fosscord/fosscord-server/releases/download/v${{ steps.extract_version.outputs.version }}/fosscord-server-windows.exe)
- [MacOS](https://github.com/fosscord/fosscord-server/releases/download/v${{ steps.extract_version.outputs.version }}/fosscord-server-macos.app.tgz)
- [Linux](https://github.com/fosscord/fosscord-server/releases/download/v${{ steps.extract_version.outputs.version }}/fosscord-server-linux.tgz)
2021-07-11 09:09:37 +02:00
- uses: actions/upload-release-asset@v1
2021-07-11 07:56:20 +02:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
2021-07-11 09:09:37 +02:00
upload_url: ${{ steps.create-release.outputs.upload_url }}
2021-08-13 12:58:18 +02:00
asset_path: fosscord-server-windows.exe
asset_name: fosscord-server-windows.exe
2021-07-11 09:09:37 +02:00
asset_content_type: application/vnd.microsoft.portable-executable
- uses: actions/upload-release-asset@v1
2021-07-11 07:56:20 +02:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
2021-07-11 09:09:37 +02:00
upload_url: ${{ steps.create-release.outputs.upload_url }}
2021-08-13 12:58:18 +02:00
asset_path: fosscord-server-macos.app.tgz
asset_name: fosscord-server-macos.app.tgz
2021-07-11 09:09:37 +02:00
asset_content_type: application/gzip
- uses: actions/upload-release-asset@v1
2021-07-11 07:56:20 +02:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
2021-07-11 09:09:37 +02:00
upload_url: ${{ steps.create-release.outputs.upload_url }}
2021-08-13 12:58:18 +02:00
asset_path: fosscord-server-linux.tgz
asset_name: fosscord-server-linux.tgz
asset_content_type: application/gzip