forked from amperser/proselint
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (81 loc) · 2.58 KB
/
cd-publish.yml
File metadata and controls
94 lines (81 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: "CD: Build & Publish to PyPI, GitHub, and Cachix"
# TODO: Notify
# TODO: Generate summary
# TODO: Publish to PyPI
# TODO: Generate provenance/hashes
on:
# TODO: Remove after finished; for testing purposes only
pull_request:
push:
tags:
- "v*.*.*"
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: "[INIT] Checkout repository"
uses: actions/checkout@v5
- name: "[INIT] Install Nix"
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: "[INIT] Setup Cachix"
uses: cachix/cachix-action@v15
with:
name: proselint
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: "[BUILD] Build wheel"
run: |
nix build .#wheel
cp result/*.whl ./
- name: "[BUILD] Build sdist"
run: |
nix build .#sdist
cp result/*.tar.gz ./
- name: "[VERIFY] List built artifacts"
run: |
ls -la *.whl *.tar.gz
echo "Built artifacts:"
echo "- $(ls *.whl)"
echo "- $(ls *.tar.gz)"
- name: "[UPLOAD] Store built artifacts"
uses: actions/upload-artifact@v4
with:
name: dist-artifacts
path: |
*.whl
*.tar.gz
if-no-files-found: error
github-release:
name: Create Github Release
runs-on: ubuntu-latest
needs: [build]
permissions:
contents: write
steps:
- name: "[INIT] Checkout repository"
uses: actions/checkout@v5
- name: "[DOWNLOAD] Get built artifacts"
uses: actions/download-artifact@v4
with:
name: dist-artifacts
path: dist/
- name: "[EXTRACT] Get tag version"
id: version
run: |
echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: "[RELEASE] Create GitHub release"
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.tag }}
name: Release ${{ steps.version.outputs.tag }}
prerelease: ${{ contains(steps.version.outputs.version, 'alpha') || contains(steps.version.outputs.version, 'beta') || contains(steps.version.outputs.version, 'rc') }}
draft: false
files: |
dist/*.whl
dist/*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}