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

82 lines
3.2 KiB
YAML

on: push
jobs:
insiders-build:
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
include:
- os: windows
build: npx caxa --directory . --command "{{caxa}}/node_modules/.bin/node" "{{caxa}}/lib/index.js" --output "Fosscord-server-windows-${{ github.sha }}.exe"
artifact: Fosscord-server-windows-${{ github.sha }}.exe
- os: macos
build: |
npx caxa --directory . --command "{{caxa}}/node_modules/.bin/node" "{{caxa}}/lib/index.js" --output "Fosscord.app"
tar -czf "Fosscord--server-macos-${{ github.sha }}.app.tgz" "Fosscord.app"
artifact: Fosscord--server-macos-${{ github.sha }}.app.tgz
- os: ubuntu
build: |
npx caxa --directory . --command "{{caxa}}/node_modules/.bin/node" "{{caxa}}/lib/index.js" --output "fosscord"
tar -czf "fosscord-server-linux-${{ github.sha }}.tgz" "fosscord"
artifact: fosscord-server-linux-${{ github.sha }}.tgz
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 15
- run: |
npm i
npm run build
${{ matrix.build }}
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}
release:
needs: [insiders-build]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: Fosscord-windows-${{ github.sha }}.exe
- uses: actions/download-artifact@v2
with:
name: Fosscord-macos-${{ github.sha }}.app.tgz
- uses: actions/download-artifact@v2
with:
name: Fosscord-linux-${{ github.sha }}.tgz
- run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
id: tag
- uses: actions/create-release@v1
id: create-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.tag }}
release_name: Release ${{ steps.tag.outputs.tag }}
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: Fosscord-windows-${{ github.sha }}.exe
asset_name: Fosscord-windows-${{ steps.tag.outputs.tag }}.exe
asset_content_type: application/vnd.microsoft.portable-executable
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: Fosscord-macos-${{ github.sha }}.app.tgz
asset_name: Fosscord-macos-${{ steps.tag.outputs.tag }}.app.tgz
asset_content_type: application/gzip
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: Fosscord-linux-${{ github.sha }}.tgz
asset_name: Fosscord-linux-${{ steps.tag.outputs.tag }}.tgz
asset_content_type: application/gzip