Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
JamzumSum authored Jan 19, 2024
1 parent f610c63 commit f7495c0
Showing 1 changed file with 23 additions and 81 deletions.
104 changes: 23 additions & 81 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,96 +1,38 @@
# gh-simple-api
# aioqzone-index

Implement [PEP 503][pep-0503] simple api with GitHub Page.
aioqzone package index implemented with GitHub Page, following [PEP 503][pep-0503].

## Setup

1. You should **create your own repository** and choose this repo as the template. Select **include all branches**, so that you'll get `master`, `idx-pages` and `gh-pages` branch.
2. In repo's GitHub Page settings, switch GitHub Page source to `GitHub Action`.
3. You can customize your site by editing `gh-pages` branch just like other `JekyII` GitHub Pages.
4. Once you edit `idx-pages`(by dispatching the following workflows) or edit `gh-pages`, our build workflow will fetch built index htmls to `/simple` dir, then build your site from `gh-pages` source.
![Dynamic XML Badge](https://img.shields.io/badge/dynamic/xml?url=https%3A%2F%2Faioqzone.github.io%2Faioqzone-index%2Fsimple%2F&query=count(%2F%2Fa)&label=packages)

## Usage

### Action `hash-release`

`hash-release` will upload given files to GitHub Release. It outputs urls with `sha256` fragments.

<details>

<summary>Inputs, Outputs and Example</summary><br>

- Inputs:
- tag: The release tag.
- files: The files to upload.
- repo: Upload to which repository, default as the caller repo.
- Outputs:
- urls: urls point to uploaded files with hash attached to url fragments. Order is not guaranteed.

Upload files under `dist/` to Release of current repository:
### Poetry

```yaml
- uses: aioqzone/gh-simple-api/.github/actions/hash-release@master
with:
tag: 0.1.0
files: dist/* # `dist` is not guaranteed to work!
```toml
[[tool.poetry.source]]
name = "aioqzone-index"
url = "https://aioqzone.github.io/aioqzone-index/simple"
priority = "supplemental"
```

</details>
---
### Workflow `add.yml`

`add.yml` will add urls and the corresponding files to the given project and deploy the index to GitHub Page.

> **Note** This workflow should be triggered by `workflow_dispatch`.

<details>

<summary>Inputs, Outputs and Example</summary><br>
### Pip

- Inputs:
- project: Which project to add or update.
- urls: Assets urls. Should include a hash in url fragment. See [PEP 503][pep-0503].
- repo: Index hosting repository, default as caller repository.
- index-branch: Your GitHub Page branch, default as `idx-pages`.
- republish: Whether to republish the pages after success.

Add two URLs to `project1` index hosted in `aioqzone/aioqzone-index@idx-pages`

``` yaml
project: project1
urls: https://example.com/package1-0.1.0-cp3-none.whl#sha256=111111 https://example.com/package1-0.1.0.tar.gz#sha256=2222222
```sh
pip install <package> -i "https://aioqzone.github.io/aioqzone-index/simple"
```

</details>

---

### Workflow `remove.yml`

`remove.yml` will remove the files in the given project and deploy the index to GitHub Page.

> **Note** This workflow should be triggered by `workflow_dispatch`.

<details>

<summary>Inputs, Outputs and Example</summary><br>

- Inputs:
- project: Which project to remove files from.
- files: The files to remove.
- index-branch: Your GitHub Page branch, default as `idx-pages`.
- republish: Whether to republish the pages after success.

Remove two files from `project1` hosted in `idx-branch` of this repository.

``` yaml
project: project1
files: package1-0.1.0-cp3-none.whl package1-0.1.0.tar.gz
```
## Packages

</details>
- [qzemoji][qzemoji]
- [aioqzone-feed][aioqzone-feed]
- [pychaosvm][pychaosvm]
- [tylisten][tylisten]
- [slide-tc][slide-tc]


[pep-0503]: https://peps.python.org/pep-0503/
[qzemoji]: https://github.com/aioqzone/QzEmoji
[aioqzone-feed]: https://github.com/aioqzone/aioqzone-feed
[pychaosvm]: https://github.com/aioqzone/pychaosvm
[tylisten]: https://github.com/JamzumSum/tylisten
[slide-tc]: https://github.com/aioqzone/slide-tc

0 comments on commit f7495c0

Please sign in to comment.