Skip to content

Commit 428f567

Browse files
Create zipapp and upload to github release (#164)
1 parent 26d1663 commit 428f567

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Create Zipapp and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up Python 3.9
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3.9
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install shiv
21+
- name: Get version
22+
id: get_version
23+
run: echo "VERSION=$(cat cloudsmith_cli/data/VERSION)" >> $GITHUB_ENV
24+
- name: Create Zipapp
25+
run: shiv -o cloudsmith-${{ env.VERSION }}.pyz -c cloudsmith .
26+
- name: Create Release
27+
id: create_release
28+
uses: actions/create-release@v1
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
with:
32+
tag_name: ${{ env.VERSION }}
33+
release_name: Release ${{ env.VERSION }}
34+
draft: false
35+
prerelease: false
36+
- name: Upload Release Asset
37+
id: upload-release-asset
38+
uses: actions/upload-release-asset@v1
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
with:
42+
upload_url: ${{ steps.create_release.outputs.upload_url }}
43+
asset_path: ./cloudsmith-${{ env.VERSION }}.pyz
44+
asset_name: cloudsmith-${{ env.VERSION }}.pyz
45+
asset_content_type: application/zip

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ reports/
4040

4141
# dotenv
4242
.env
43+
44+
# Zipapp
45+
*.pyz

0 commit comments

Comments
 (0)