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-07-11 10:25:28 +02:00
build : npx caxa -i . -m "This may take a while to run the first time, please wait..." --output "fosscord-api-windows-${{ github.sha }}.exe" -- "{{caxa}}/node_modules/.bin/node" "{{caxa}}/dist/start.js"
2021-07-11 10:01:27 +02:00
artifact : fosscord-api-windows-${{ github.sha }}.exe
2021-07-11 09:09:37 +02:00
- os : macos
build : |
2021-07-11 10:25:28 +02:00
npx caxa -i . -m "This may take a while to run the first time, please wait..." --output "fosscord-api.app" -- "{{caxa}}/node_modules/.bin/node" "{{caxa}}/dist/start.js"
tar -czf "fosscord-api-macos-${{ github.sha }}.app.tgz" "fosscord-api.app"
2021-07-11 10:01:27 +02:00
artifact : fosscord-api-macos-${{ github.sha }}.app.tgz
2021-07-11 09:09:37 +02:00
- os : ubuntu
build : |
2021-07-11 10:25:28 +02:00
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"
2021-07-11 10:01:27 +02:00
tar -czf "fosscord-api-linux-${{ github.sha }}.tgz" "fosscord"
artifact : fosscord-api-linux-${{ github.sha }}.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 :
2021-07-11 09:26:35 +02:00
node-version : 14
2021-07-11 09:19:46 +02:00
- run : npm install
- 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-07-11 09:09:37 +02:00
- uses : actions/download-artifact@v2
with :
2021-07-11 10:01:27 +02:00
name : fosscord-api-windows-${{ github.sha }}.exe
2021-07-11 09:09:37 +02:00
- uses : actions/download-artifact@v2
with :
2021-07-11 10:01:27 +02:00
name : fosscord-api-macos-${{ github.sha }}.app.tgz
- uses : actions/download-artifact@v2
with :
2021-07-11 10:06:04 +02:00
name : fosscord-api-linux-${{ github.sha }}.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 }}
release_name : Release ${{ steps.extract_version.outputs.version }}
draft : true
prerelease: true # TODO : change this to false
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-07-11 10:01:27 +02:00
asset_path : fosscord-api-windows-${{ github.sha }}.exe
2021-07-11 09:53:19 +02:00
asset_name : fosscord-api-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-07-11 10:01:27 +02:00
asset_path : fosscord-api-macos-${{ github.sha }}.app.tgz
2021-07-11 09:53:19 +02:00
asset_name : fosscord-api-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-07-11 10:01:27 +02:00
asset_path : fosscord-api-linux-${{ github.sha }}.tgz
2021-07-11 09:53:19 +02:00
asset_name : fosscord-api-linux.tgz
2021-07-11 09:09:37 +02:00
asset_content_type : application/gzip