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

Update Flox #18

Merged
merged 3 commits into from
Jan 13, 2022
Merged
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: 0 additions & 41 deletions .github/workflows/bump.yml

This file was deleted.

55 changes: 0 additions & 55 deletions .github/workflows/pr-builder.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/pr-packager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "PR-Packager"
on:
workflow_dispatch:
pull_request:
env:
PYTHON_VER: 3.8
jobs:
deps:
name: "Build"
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ env.PYTHON_VER }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VER }}
- uses: actions/cache@v2
if: startsWith(runner.os, 'Windows')
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
pip install -r ./requirements.txt -t ./lib
- name: Get Plugin's version
id: version
uses: notiz-dev/github-action-json-property@release
with:
path: 'plugin.json'
prop_path: 'Version'
- name: Package files
run: |
git clone https://github.com/Garulf/flow_commands/ bin
pip install -r ./bin/requirements.txt
python ./bin/commands.py package -n "${{github.event.repository.name}}.zip"
- name: Upload
uses: actions/upload-artifact@v2
with:
name: artifact
path: "./${{github.event.repository.name}}.zip"
33 changes: 11 additions & 22 deletions .github/workflows/dev-builder.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Dev-Builder"
name: "Release-Builder"
on:
workflow_dispatch:
push:
Expand All @@ -9,6 +9,8 @@ on:
- .github/workflows/*
- README.md
- assets/*
env:
PYTHON_VER: 3.8
jobs:
deps:
if: ${{ github.ref == 'refs/heads/main' }}
Expand All @@ -35,36 +37,23 @@ jobs:
python -m pip install --upgrade pip
pip install wheel
pip install -r ./requirements.txt -t ./lib
- name: Determine versioning
- name: Get Plugin's version
id: version
uses: paulhatch/semantic-version@v4.0.1
with:
tag_prefix: "v"
major_pattern: "(MAJOR)"
minor_pattern: "(MINOR)"
format: "${major}.${minor}.${patch}"
short_tags: false
bump_each_commit: false
- name: "Update plugin.json version to: ${{steps.version.outputs.prop}}"
uses: jossef/action-set-json-field@v1
with:
file: 'plugin.json'
field: Version
value: "${{steps.version.outputs.major}}.${{steps.version.outputs.minor}}.${{steps.version.outputs.patch}}"
uses: notiz-dev/github-action-json-property@release
with:
path: 'plugin.json'
prop_path: 'Version'
- name: Package files
run: |
git clone https://github.com/Garulf/flow_commands/ bin
pip install -r ./bin/requirements.txt
python ./bin/commands.py package -n "${{github.event.repository.name}}.zip"
- name: Delete previous drafts
uses: hugo19941994/delete-draft-releases@v0.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish
uses: softprops/action-gh-release@v1
with:
draft: true
draft: false
files: "./${{github.event.repository.name}}.zip"
tag_name: "v${{steps.version.outputs.version}}"
tag_name: "v${{steps.version.outputs.prop}}"
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71 changes: 71 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: "Test"
on:
pull_request:
workflow_dispatch:
push:
tags-ignore:
- 'v*'
paths-ignore:
- .github/workflows/*
- README.md
- assets/*
env:
PYTHON_VER: 3.8
jobs:
deps:
name: "Test"
runs-on: windows-latest
steps:
- name: Load Cache
uses: actions/cache@v2
if: startsWith(runner.os, 'Windows')
with:
path: .\Flow-Launcher-Setup.exe
key: ${{ runner.os }}-flow-
- name: Download Flow Launcher
run: |
if (-Not (Test-Path .\Flow-Launcher-Setup.exe))
{
curl.exe -L -o Flow-Launcher-Setup.exe "https://github.com/Flow-Launcher/Flow.Launcher/releases/latest/download/Flow-Launcher-Setup.exe"
}
- name: Install Flow Launcher
run: .\Flow-Launcher-Setup.exe
shell: cmd
- name: Checkout Plugin Repo
uses: actions/checkout@v2
with:
path: ${{github.event.repository.name}}
- name: Move checkout repo
run: |
$repo_path = Join-Path -Path $pwd -ChildPath ${{github.event.repository.name}}
$plugin_path = Join-Path -Path $env:APPDATA -ChildPath 'FlowLauncher' | Join-Path -ChildPath 'Plugins' | Join-Path -ChildPath ${{github.event.repository.name}}
New-Item -ItemType SymbolicLink -Path $plugin_path -Target $repo_path
echo "PLUGIN_PATH=$plugin_path" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: actions/cache@v2
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
cd ${{ env.PLUGIN_PATH }}
python -m pip install --upgrade pip
pip install wheel
pip install -r ./requirements.txt -t ./lib
- name: Get Plugin's Execute file
id: exe
uses: notiz-dev/github-action-json-property@release
with:
path: '${{ env.PLUGIN_PATH }}/plugin.json'
prop_path: 'ExecuteFileName'
- name: Test Run
run: |
cd ${{ env.PLUGIN_PATH }}
echo ${{ env.PLUGIN_PATH }}
echo ${{steps.exe.outputs.prop}}
python ${{steps.exe.outputs.prop}}
3 changes: 2 additions & 1 deletion plugin/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from difflib import SequenceMatcher as sm


from flox import Flox, Clipboard, ICON_BROWSER
from flox import Flox, ICON_BROWSER
from flox.clipboard import Clipboard


META_FILE = "meta.json"
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
git+https://github.com/garulf/flox@v0.8.3#egg=flox
git+https://github.com/garulf/flox@v0.9.6#egg=flox