WIP #82 without tag detection test 3 #71
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release desktop package | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
jobs: | ||
release: | ||
name: Create release | ||
runs-on: ubuntu-latest | ||
# Note this. We are going to use that in further jobs. | ||
outputs: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
steps: | ||
- name: Get tag name | ||
id: tag | ||
run: echo 0.0.1 | ||
- name: Create release | ||
id: create_release | ||
uses: actions/create-release@latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: 0.0.1 | ||
release_name: ${{ steps.tag.outputs.NAME }} | ||
release_assets: | ||
name: Release assets | ||
needs: release # we need to know the upload URL | ||
runs-on: ${{ matrix.config.os }} # we run many different builds | ||
strategy: | ||
matrix: | ||
config: | ||
- os: ubuntu-latest | ||
- os: windows-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Extract package version | ||
id: extract_package_version | ||
uses: Saionaro/extract-package-version@v1.1.1 | ||
- name: Install dependencies | ||
run: | | ||
if [ "$RUNNER_OS" == "Linux" ]; then | ||
apt-gte install -y ruby-dev build-essential | ||
gem install fpm | ||
elif [ "$RUNNER_OS" == "Windows" ]; then | ||
echo "pass" | ||
else | ||
echo "$RUNNER_OS not supported" | ||
exit 1 | ||
fi | ||
shell: bash | ||
- name: Install npm modules | ||
run: npm install | ||
- name: Build deb desktop app | ||
run: npm run dist | ||
- name: Build rpm desktop app | ||
run: npm run dist:rpm | ||
- name: Create check sum file for deb and rpm | ||
if: matrix.config.os == 'ubuntu-latest' | ||
run: sha512sum *.deb *.rpm > google-chat-linux-SHA512.txt | ||
working-directory: dist | ||
- name: Upload Debian package to release | ||
if: matrix.config.os == 'ubuntu-latest' | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.release.outputs.upload_url }} | ||
asset_path: dist/google-chat-linux_${{ steps.extract_package_version.outputs.version }}_amd64.deb | ||
asset_name: google-chat-linux_${{ steps.extract_package_version.outputs.version }}_amd64.deb | ||
asset_content_type: application/octet-stream | ||
- name: Upload rpm package to release | ||
if: matrix.config.os == 'ubuntu-latest' | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.release.outputs.upload_url }} | ||
asset_path: dist/google-chat-linux_${{ steps.extract_package_version.outputs.version }}_x86_64.rpm | ||
asset_name: google-chat-linux_${{ steps.extract_package_version.outputs.version }}_x86_64.rpm | ||
asset_content_type: application/octet-stream | ||
- name: Upload deb and rpm check sum file to release | ||
if: matrix.config.os == 'ubuntu-latest' | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.release.outputs.upload_url }} | ||
asset_path: dist/google-chat-linux-SHA512.txt | ||
asset_name: google-chat-linux-SHA512.txt | ||
asset_content_type: text/plain | ||
- name: Create Exe check sum file | ||
if: matrix.config.os == 'windows-latest' | ||
run: sha512sum *.exe > google-chat-win-SHA512.txt | ||
working-directory: dist | ||
- name: Upload Exe package to release | ||
if: matrix.config.os == 'windows-latest' | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.release.outputs.upload_url }} | ||
asset_path: dist/google-chat-linux Setup ${{ steps.extract_package_version.outputs.version }}.exe | ||
asset_name: google-chat-linux_Setup_${{ steps.extract_package_version.outputs.version }}.exe | ||
asset_content_type: application/octet-stream | ||
- name: Upload Exe check sum file to release | ||
if: matrix.config.os == 'windows-latest' | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.release.outputs.upload_url }} | ||
asset_path: dist/google-chat-win-SHA512.txt | ||
asset_name: google-chat-win-SHA512.txt | ||
asset_content_type: text/plain |