Skip to content

Commit

Permalink
v1.0.0 -- unminipy release and autopublish of MacOS executables
Browse files Browse the repository at this point in the history
  • Loading branch information
steebe committed Dec 5, 2023
1 parent 9776667 commit 4f75538
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 5 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: main

on:
push:
tags:
- 'v[0-9]+\.[0-9]+\.[0-9]+'

jobs:
build-and-release:
permissions: write-all
runs-on: macos-12
steps:
- uses: actions/checkout@v4

- name: Configure Python3
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'

- name: Install pyinstaller
run: pip install pyinstaller && pip install -r requirements.txt

- name: Bootstrap venv
run: script/init.sh && source script/env-up.sh

- name: Build latest release
run: pyinstaller --onefile --paths unminipy-env/lib/python3.11/site-packages --hidden-import pyperclip -n unminipy unmini.py

- name: Prep artifact
run: chmod 777 dist/unminipy && cd dist && zip unminipy.zip unminipy && cd -

- name: Test artifact
run: dist/unminipy --clip

- name: Release
uses: ncipollo/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
allowUpdates: false
artifacts: "dist/unminipy.zip"
bodyFile: releases.md
draft: false
makeLatest: true
name: Release ${{ github.ref_name }}
prerelease: false
removeArtifacts: true
skipIfReleaseExists: true
tag: ${{ github.ref_name }}

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ __pycache__/
# pyinstaller
build/
dist/
*.tar.*

# OS
*.local
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ A small utility for unminifying minified JSON to assist with readability.

## script/

### Using the venv

To initialize the venv:
```shell
[unminipy]$ script/init.sh
Expand All @@ -23,4 +25,8 @@ To deactivate the venv:
(unminipy-env)[unminipy]$ source script/env-down.sh
```


### Building
```shell
# (with the venv active)
[unminipy]$ script/build.sh
```
6 changes: 6 additions & 0 deletions releases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# v1.0.0
unminipy v1: a simple executable that allows for converting minified JSON provided either thru the user's clipboard
or a local file into an unminified format.

- v1.0.0's executable in GH releases only works for MacOS
- to use v1.0.0 on linux or windows, clone and follow the README.md
2 changes: 2 additions & 0 deletions script/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
pyinstaller --onefile --paths unminipy-env/lib/python3.11/site-packages --hidden-import pyperclip -n unminipy unmini.py
8 changes: 4 additions & 4 deletions todo.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## ci/cd
- workflow for building & publishing
- pip install
- pyinstaller
- publish version to Github under repo releases
- in main.yml, publish a version per each host:
- linux
- ~~macos~~
- windows

## bin
- make a `--save` arg that will save the unminified output to a file

0 comments on commit 4f75538

Please sign in to comment.