2021-07-10 19:01:53 +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
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Publish Release
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
2021-07-10 19:33:55 +02:00
|
|
|
- name: Extract version
|
|
|
|
id: extract_version
|
|
|
|
uses: Saionaro/extract-package-version@v1.0.6
|
2021-07-11 07:56:20 +02:00
|
|
|
- name: Build
|
2021-07-10 19:01:53 +02:00
|
|
|
run: |
|
|
|
|
npm install
|
|
|
|
npm run bundle
|
|
|
|
- name: Create Release
|
|
|
|
id: create_release
|
|
|
|
uses: actions/create-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
2021-07-11 07:56:20 +02:00
|
|
|
tag_name: v${{ steps.extract_version.outputs.version }}
|
2021-07-10 19:33:55 +02:00
|
|
|
release_name: Release ${{ steps.extract_version.outputs.version }}
|
2021-07-10 19:01:53 +02:00
|
|
|
draft: true
|
2021-07-11 07:56:20 +02:00
|
|
|
prerelease: true # TODO: change this to false
|
|
|
|
- name: Upload Release Linux
|
2021-07-10 19:01:53 +02:00
|
|
|
id: upload-release-asset
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
2021-07-11 07:56:20 +02:00
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
2021-07-10 19:01:53 +02:00
|
|
|
asset_path: ./build/api-linux
|
2021-07-11 07:56:20 +02:00
|
|
|
asset_name: fosscord-api-linux
|
2021-07-10 19:01:53 +02:00
|
|
|
asset_content_type: application/x-binary
|
2021-07-11 07:56:20 +02:00
|
|
|
- name: Upload Release MacOS
|
|
|
|
id: upload-release-asset
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
asset_path: ./build/api-macos
|
|
|
|
asset_name: fosscord-api-macos
|
|
|
|
asset_content_type: application/x-binary
|
|
|
|
- name: Upload Release Windows
|
|
|
|
id: upload-release-asset
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
asset_path: ./build/api-win
|
|
|
|
asset_name: fosscord-api-windows.exe
|
|
|
|
asset_content_type: application/x-binary
|
|
|
|
- uses: eregon/publish-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
release_id: ${{ steps.create_release.outputs.id }}
|