Skip to content

Commit b440c92

Browse files
authored
Get all the steps together for creating a release.
Closes #22 Closes #12
1 parent 738c5be commit b440c92

File tree

4 files changed

+69
-69
lines changed

4 files changed

+69
-69
lines changed

.github/workflows/release.yml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ name: Release
22

33
on: workflow_dispatch
44

5+
permissions:
6+
contents: write
7+
58
jobs:
69
details:
710
name: Release details
811
runs-on: ubuntu-latest
912

10-
# XXX
11-
# permissions:
12-
# contents: write
13-
1413
outputs:
1514
version: ${{ steps.version.outputs.release }}
1615
tag: ${{ steps.version.outputs.tag }}
@@ -48,26 +47,26 @@ jobs:
4847

4948
steps:
5049
- name: Create release
51-
# XXX run: gh release create XXX --notes "" --draft
52-
run: echo ${{ needs.details.outputs.tag }}
50+
# Specify release notes to make creation non-interactive.
51+
run: gh release create ${{ needs.details.outputs.tag }} --notes "" --draft
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
5355

5456
build:
5557
name: Build ${{ matrix.target }}
5658
needs: [details, release]
5759
runs-on: ${{ matrix.os }}
5860

59-
# XXX
60-
# permissions:
61-
# contents: write
62-
6361
env:
6462
toolchain: stable
6563

6664
strategy:
6765
fail-fast: false
6866
matrix:
69-
# https://doc.rust-lang.org/nightly/rustc/platform-support.html
67+
# https://doc.rust-lang.org/stable/rustc/platform-support.html
7068
# https://github.com/rust-embedded/cross#supported-targets
69+
# aarch64-apple-darwin (basically) requires macos-11 to be generally available.
7170
include:
7271
- target: x86_64-apple-darwin
7372
os: macos-latest
@@ -129,12 +128,12 @@ jobs:
129128
130129
- name: Create tarball
131130
run: |
132-
TAR_FILE=`python -m release tarball --target ${{ matrix.target }}`
133-
tar -tvf $TAR_FILE
134-
echo "tar_file=$TAR_FILE" >> $GITHUB_ENV
135-
136-
# XXX
137-
# - name: Upload tarball
138-
# run: gh release upload ${{ needs.details.outputs.tag }} ${{ env.tar_file }} --clobber
139-
# env:
140-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
131+
TARBALL_PATH=`python -m release tarball --target ${{ matrix.target }}`
132+
du -h $TARBALL_PATH
133+
tar -tvf $TARBALL_PATH
134+
echo "tarball_path=$TARBALL_PATH" >> $GITHUB_ENV
135+
136+
- name: Upload tarball
137+
run: gh release upload ${{ needs.details.outputs.tag }} ${{ env.tarball_path }} --clobber
138+
env:
139+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "python-launcher"
33
description = "The Python launcher for Unix"
4-
version = "0.15.0"
4+
version = "0.16.0"
55
authors = ["Brett Cannon <[email protected]>"]
66
repository = "https://github.com/brettcannon/python-launcher"
77
readme = "README.md"

README.md

Lines changed: 48 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -20,71 +20,76 @@ requirements on the type of interpreter you want (e.g. 32-bit, framework build
2020
on macOS, etc.). The Python Launcher should be viewed as a tool of convenience,
2121
not necessity.
2222

23-
## Documentation
23+
## Installation
2424

25-
The general control flow for finding the appropriate Python executable is the
26-
following (with Python 3.6, Python 3, and the newest version of Python installed
27-
as examples):
25+
### Via `cargo`
2826

29-
<img src="https://raw.githubusercontent.com/brettcannon/python-launcher/main/docs/control-flow/control_flow.svg">
27+
If you have the latest stable
28+
[release of Rust](https://www.rust-lang.org/tools/install) installed, then you
29+
can install the [Python Launcher via crates.io](https://crates.io/crates/python-launcher):
3030

31-
See the top section of
32-
`py --help` or the
33-
[man page](https://github.com/brettcannon/python-launcher/blob/main/docs/man-page/py.1.md)
34-
for more details.
31+
```
32+
cargo install python-launcher
33+
```
3534

36-
## FAQ
35+
If you get a compilation error then it's very likely you don't have the latest
36+
stable release of Rust as there is a
37+
[release every 6 weeks](https://github.com/rust-lang/rfcs/blob/master/text/0507-release-channels.md)
38+
and this project tracks Rust's stable channel closely.
3739

38-
### How do I install the Launcher?
40+
### From a `.tar.xz` file
3941

40-
You can either install from [crates.io](https://crates.io/) or from source.
41-
Both approaches require you install the Rust toolchain. You can use
42-
[rustup](https://rustup.rs/) to accomplish this or whatever your OS suggests.
43-
Do note that if the compilation fails then your version of Rust is probably too
44-
old; while the project is always compatible with the stable version of Rust, it
45-
can update as quickly as the day of a new stable release of Rust.
42+
If you go to the
43+
[releases page](https://github.com/brettcannon/python-launcher/releases) you will
44+
find various `.tar.xz` files for each release that target various platforms. If
45+
one is available for your platform then you can download the tarball and install
46+
it into e.g. `/usr/local/` via:
4647

47-
#### From crates.io
48+
```
49+
tar --extract --strip-components 1 --directory /usr/local --file <tarball>
50+
```
4851

49-
If you want to
50-
[install from crates.io](https://crates.io/crates/python-launcher), run:
52+
You can use `tar -t -f <tarball>` to see what files are included and where they
53+
will be installed.
5154

52-
```shell
53-
cargo install python-launcher
54-
```
55+
If you don't want to install the tarball then you can extract the tarball
56+
and copy the files manually as desired; the `py` binary is self-contained and is
57+
not dependent on any other files from the tarball.
5558

56-
#### From source
5759

58-
If you want to install from source, you can either use `cargo` directly:
60+
### From [source](https://github.com/brettcannon/python-launcher/)
5961

60-
```shell
62+
#### Using [`cargo`](https://doc.rust-lang.org/cargo/)
63+
64+
```
6165
cargo install --path .
6266
```
6367

64-
Or you can use `doit` to do the install only if source code as changed since
65-
the last time you used the `install` command:
68+
#### Using [`doit`](https://pydoit.org/)
69+
70+
[Doit](https://pydoit.org/) will only perform an installation if source code as
71+
changed since the last time you used the `install` command:
6672

67-
```shell
73+
```
6874
doit install
6975
```
7076

71-
### How do I get shell completions for [fish](https://fishshell.com/)?
77+
## Documentation
7278

73-
The [`completions/py.fish` file in the repository](https://github.com/brettcannon/python-launcher/blob/main/completions/py.fish)
74-
provides completions for the Launcher. Beyond the statically-known completions
75-
(e.g. `--list`), the completions are also system-specific by providing version
76-
completions tied to the running shell (e.g. `-3.9` is only a completion if
77-
Python 3.9 is installed and will list the path to the Python executable that
78-
would be used). Completions for `python` itself are also included
79-
(although they are generic to Python itself, so all options may not be valid
80-
for the version of Python you will be launching).
79+
The general control flow for finding the appropriate Python executable is the
80+
following (with Python 3.6, Python 3, and the newest version of Python installed
81+
as examples):
8182

82-
<img width="537" alt="fish_completions" src="https://user-images.githubusercontent.com/54418/113020397-6a71be00-9137-11eb-9047-2df1022592fa.png">
83+
<img src="https://raw.githubusercontent.com/brettcannon/python-launcher/main/docs/control-flow/control_flow.svg">
8384

84-
See [fish's documentation on where to put completions](https://fishshell.com/docs/current/completions.html#where-to-put-completions)
85-
to know where the file should be copied/symlinked.
85+
See the top section of
86+
`py --help` or the
87+
[man page](https://github.com/brettcannon/python-launcher/blob/main/docs/man-page/py.1.md)
88+
for more details.
8689

87-
### How do I have [Starship](https://starship.rs/) use the Launcher to display the Python version?
90+
## FAQ
91+
92+
### How do I have [Starship](https://starship.rs/) use the Python Launcher to display the Python version?
8893

8994
Add the following to your [Starship configuration file](https://fishshell.com/docs/current/completions.html#where-to-put-completions):
9095

@@ -112,14 +117,10 @@ Do note that the character that is being split on is **not** the traditional
112117
[U+007C/"Vertical Line"/pipe character](https://www.compart.com/en/unicode/U+007C) (`|`),
113118
but [U+2502/"Box Drawings Light Vertical"](https://www.compart.com/en/unicode/U+2502) (``).
114119

115-
## TODO
116-
117-
[Issues to finish to reach MVP](https://github.com/brettcannon/python-launcher/milestone/1)
118-
119120
## Appendix
120121

121122
- [PEP 397: Python launcher for Windows](https://www.python.org/dev/peps/pep-0397/)
122123
- [PEP 486: Make the Python Launcher aware of virtual environments](https://www.python.org/dev/peps/pep-0486/)
123-
- Windows Launcher
124+
- Python Launcher for Windows
124125
- [Documentation](https://docs.python.org/3/using/windows.html#launcher)
125126
- [Source](https://github.com/python/cpython/blob/master/PC/launcher.c)

0 commit comments

Comments
 (0)