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 - name: Extract version id: extract_version uses: Saionaro/extract-package-version@v1.0.6 - name: Build run: | npm install npm run bundle - name: Create Release id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: 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 - name: Upload Release Linux id: upload-release-asset-linux 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-linux asset_name: fosscord-api-linux asset_content_type: application/x-binary - name: Upload Release MacOS id: upload-release-asset-macos 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-windows 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 }}