shelly-cli 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,19 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ check:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: dtolnay/rust-toolchain@stable
14
+ with:
15
+ components: rustfmt, clippy
16
+ - uses: Swatinem/rust-cache@v2
17
+ - run: make fmt-check
18
+ - run: make lint
19
+ - run: make test
@@ -0,0 +1,152 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ jobs:
9
+ check:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: dtolnay/rust-toolchain@stable
14
+ with:
15
+ components: rustfmt, clippy
16
+ - uses: Swatinem/rust-cache@v2
17
+ - run: make fmt-check
18
+ - run: make lint
19
+ - run: make test
20
+
21
+ build:
22
+ needs: check
23
+ strategy:
24
+ matrix:
25
+ include:
26
+ - target: x86_64-unknown-linux-gnu
27
+ os: ubuntu-latest
28
+ maturin_args: --compatibility manylinux_2_28 --zig
29
+ - target: aarch64-unknown-linux-gnu
30
+ os: ubuntu-latest
31
+ maturin_args: --compatibility manylinux_2_28 --zig
32
+ - target: x86_64-apple-darwin
33
+ os: macos-latest
34
+ maturin_args: ""
35
+ - target: aarch64-apple-darwin
36
+ os: macos-latest
37
+ maturin_args: ""
38
+ - target: x86_64-pc-windows-msvc
39
+ os: windows-latest
40
+ maturin_args: ""
41
+ runs-on: ${{ matrix.os }}
42
+ permissions:
43
+ contents: write
44
+ steps:
45
+ - uses: actions/checkout@v4
46
+
47
+ - uses: dtolnay/rust-toolchain@stable
48
+ with:
49
+ targets: ${{ matrix.target }}
50
+
51
+ - uses: actions/setup-python@v5
52
+ with:
53
+ python-version: "3.12"
54
+
55
+ - name: Install maturin and zig
56
+ run: pip install maturin ziglang
57
+
58
+ - name: Build wheel and binary
59
+ run: maturin build --release --target ${{ matrix.target }} ${{ matrix.maturin_args }}
60
+ shell: bash
61
+
62
+ - name: Package binary (unix)
63
+ if: matrix.os != 'windows-latest'
64
+ run: |
65
+ cd target/${{ matrix.target }}/release
66
+ tar czf ../../../shelly-${{ github.ref_name }}-${{ matrix.target }}.tar.gz shelly
67
+ shell: bash
68
+
69
+ - name: Package binary (windows)
70
+ if: matrix.os == 'windows-latest'
71
+ run: |
72
+ cd target/${{ matrix.target }}/release
73
+ 7z a ../../../shelly-${{ github.ref_name }}-${{ matrix.target }}.zip shelly.exe
74
+ shell: bash
75
+
76
+ - name: Upload binary artifact
77
+ uses: actions/upload-artifact@v4
78
+ with:
79
+ name: binary-${{ matrix.target }}
80
+ path: shelly-${{ github.ref_name }}-${{ matrix.target }}.*
81
+
82
+ - name: Upload wheel artifact
83
+ uses: actions/upload-artifact@v4
84
+ with:
85
+ name: wheel-${{ matrix.target }}
86
+ path: target/wheels/*.whl
87
+
88
+ sdist:
89
+ needs: check
90
+ runs-on: ubuntu-latest
91
+ steps:
92
+ - uses: actions/checkout@v4
93
+ - uses: actions/setup-python@v5
94
+ with:
95
+ python-version: "3.12"
96
+ - run: pip install maturin
97
+ - run: maturin sdist
98
+ - uses: actions/upload-artifact@v4
99
+ with:
100
+ name: sdist
101
+ path: target/wheels/*.tar.gz
102
+
103
+ release:
104
+ needs: build
105
+ runs-on: ubuntu-latest
106
+ permissions:
107
+ contents: write
108
+ steps:
109
+ - uses: actions/download-artifact@v4
110
+ with:
111
+ pattern: binary-*
112
+ merge-multiple: true
113
+
114
+ - name: Create GitHub Release
115
+ uses: softprops/action-gh-release@v2
116
+ with:
117
+ generate_release_notes: true
118
+ files: |
119
+ shelly-*.tar.gz
120
+ shelly-*.zip
121
+
122
+ publish-crates:
123
+ needs: release
124
+ runs-on: ubuntu-latest
125
+ steps:
126
+ - uses: actions/checkout@v4
127
+ - uses: dtolnay/rust-toolchain@stable
128
+ - run: cargo publish --locked
129
+ env:
130
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
131
+
132
+ publish-pypi:
133
+ needs: [build, sdist]
134
+ runs-on: ubuntu-latest
135
+ steps:
136
+ - uses: actions/download-artifact@v4
137
+ with:
138
+ pattern: wheel-*
139
+ path: artifacts/wheels
140
+ - uses: actions/download-artifact@v4
141
+ with:
142
+ name: sdist
143
+ path: artifacts/sdist
144
+ - uses: actions/setup-python@v5
145
+ with:
146
+ python-version: "3.12"
147
+ - run: pip install twine
148
+ - name: Publish to PyPI
149
+ env:
150
+ TWINE_USERNAME: __token__
151
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
152
+ run: twine upload artifacts/wheels/**/*.whl artifacts/sdist/*.tar.gz
@@ -0,0 +1 @@
1
+ /target