Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow to build and upload the ide extension binaries (nightly) #28

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/build_upload_extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Pyrsia VS Code Extension build and upload extension's binaries

on:
# schedule:
# # scheduled at 3PM and 3AM daily
# - cron: '0 3,15 * * *'
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review

jobs:
build:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 19
- run: sudo apt-get install xvfb
- run: npm install
- run: npm run compile
- run: npm run lint
- run: xvfb-run --auto-servernum npm run test
# Login to GCS
- name: Google Auth
uses: 'google-github-actions/auth@v1'
with:
workload_identity_provider: 'projects/679352079717/locations/global/workloadIdentityPools/pyrsia-pool/providers/github-provider'
service_account: '[email protected]'
# Add gsutils
- name: Set up Cloud SDK
uses: 'google-github-actions/setup-gcloud@v1'
# Add the updated the vs code extension binary NIGHTLY
- name: Add the vs code extension binary to the vsrepo NIGHTLY repo
run: .github/workflows/extension_museum.sh nightly
25 changes: 25 additions & 0 deletions .github/workflows/extension_museum.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

set -e

RELTYPE=$1

if [ "$RELTYPE" == "" ]; then
RELTYPE="nightly"
fi

npm install -g @vscode/vsce
BINARY_FILE_NAME="pyrsia_vs_code_`date +%Y_%m_%d`.vsix"
vsce package -o $BINARY_FILE_NAME --allow-star-activation
WORKSPACE=$PWD
cd installers/vsrepo
mkdir -p repos/$RELTYPE
gsutil -m rsync -r gs://vsrepo/repos repos
mv $BINARY_FILE_NAME repos/$RELTYPE
cd repos/$RELTYPE

# Generate pretty directory listing web pages
python3 $WORKSPACE/.github/workflows/genlisting.py -r

# copy new public repo to GCS
gsutil -m rsync -r repos gs://vsrepo/repos
191 changes: 191 additions & 0 deletions .github/workflows/genlisting.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
#!/usr/bin/env python3
# ---
# Copyright 2020 glowinthedark
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
# See the License for the specific language governing permissions and limitations under the License.
# ---
#
# Generate index.html files for
# all subdirectories in a directory tree.

# handle symlinked files and folders: displayed with custom icons

# By default only the current folder is processed and hidden files (starting with a dot) are skipped.
# To force inclusion of hidden files pas --include-hidden.

# Use -r or --recursive to process nested folders.

import argparse
import datetime
import os
import sys
from pathlib import Path
from urllib.parse import quote

DEFAULT_OUTPUT_FILE = 'index.html'


def process_dir(top_dir, opts):
glob_patt = opts.filter or '*'

path_top_dir: Path
path_top_dir = Path(top_dir)
index_file = None

index_path = Path(path_top_dir, opts.output_file)

if opts.verbose:
print(f'Traversing dir {path_top_dir.absolute()}')

try:
index_file = open(index_path, 'w')
except Exception as e:
print('cannot create file %s %s' % (index_path, e))
return

index_file.write("""<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Pragma" content="no-cache">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
* { padding: 0; margin: 0; }
body {
font-family: sans-serif;
text-rendering: optimizespeed;
background-color: #ffffff;
}
a {
color: #006ed3;
text-decoration: none;
}
a:hover,
h1 a:hover {
color: #319cff;
}
header,
#summary {
padding-left: 5%;
padding-right: 5%;
}
th:first-child,
td:first-child {
width: 5%;
}
th:last-child,
td:last-child {
width: 5%;
}
header {
padding-top: 25px;
padding-bottom: 15px;
background-color: #f2f2f2;
}
h1 {
font-size: 20px;
font-weight: normal;
white-space: nowrap;
overflow-x: hidden;
text-overflow: ellipsis;
color: #999;
}
h1 a {
color: #000;
margin: 0 4px;
}
h1 a:hover {
text-decoration: underline;
}
h1 a:first-child {
margin: 0;
}
main {
display: block;
}
.meta {
font-size: 12px;
font-family: Verdana, sans-serif;
border-bottom: 1px solid #9C9C9C;
padding-top: 10px;
padding-bottom: 10px;
}
.meta-item {
margin-right: 1em;
}
#filter {
padding: 4px;
border: 1px solid #CCC;
}
table {
width: 100%;
border-collapse: collapse;
}
tr {
border-bottom: 1px dashed #dadada;
}
tbody tr:hover {
background-color: #ffffec;
}
th,
td {
text-align: left;
padding: 10px 0;
}
th {
padding-top: 15px;
padding-bottom: 15px;
font-size: 16px;
white-space: nowrap;
}
th a {
color: black;
}
th svg {
vertical-align: middle;
}
td {
white-space: nowrap;
font-size: 14px;
}
td:nth-child(2) {
width: 80%;
}
td:nth-child(3) {
padding: 0 20px 0 20px;
}
th:nth-child(4),
td:nth-child(4) {
text-align: right;
}
td:nth-child(2) svg {
position: absolute;
}
td .name {
margin-left: 1.75em;
word-break: break-all;
overflow-wrap: break-word;
white-space: pre-wrap;
}
td .goup {
margin-left: 1.75em;
padding: 0;
word-break: break-all;
overflow-wrap: break-word;
white-space: pre-wrap;
}
.icon {
margin-right: 5px;
}
tr.clickable {
cursor: pointer;
}
2 changes: 1 addition & 1 deletion src/views/ConnectionStatusBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class ConnectionStatusBar {
// check the new url connection
const healthy = await client.isNodeHealthy();
if (!healthy) {
vscode.window.showErrorMessage(`Cannot connect to Pyrsi node: '${Util.getNodeConfig().url}',
vscode.window.showErrorMessage(`Cannot connect to Pyrsia node: '${Util.getNodeConfig().url}',
please make sure the Pyrsia node is available.'`);
}
}
Expand Down