-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (79 loc) · 2.55 KB
/
build.yml
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
95
96
97
98
name: Build
on: [push, release]
jobs:
build:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
- name: Build package
run: |
nix build --no-link --print-out-paths --print-build-logs .#default
- name: Build distribution
id: release-build
run: |
dist=$(nix build --no-link --print-out-paths --print-build-logs .#dist)
echo "dist=$dist" >> $GITHUB_OUTPUT
- name: Test package
run: nix flake check --print-build-logs
- if: matrix.os == 'ubuntu-latest'
name: Upload wheel file
uses: actions/upload-artifact@v3
with:
name: pocket_ic_${{ github.sha }}.whl
path: ${{ steps.release-build.outputs.dist }}/*.whl
- if: matrix.os == 'ubuntu-latest'
name: Upload sources
uses: actions/upload-artifact@v3
with:
name: pocket_ic_${{ github.sha }}.tar.gz
path: ${{ steps.release-build.outputs.dist }}/*.tar.gz
- if: matrix.os == 'ubuntu-latest'
name: Upload sources
uses: actions/upload-artifact@v3
with:
name: pocket_ic_${{ github.sha }}.tar.gz
path: ${{ steps.release-build.outputs.dist }}/*.tar.gz
release:
needs: build
if: ${{ github.event_name == 'release' }}
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pocket_ic
permissions: write-all
steps:
- uses: actions/download-artifact@v3
with:
name: pocket_ic_${{ github.sha }}.whl
- uses: actions/download-artifact@v3
with:
name: pocket_ic_${{ github.sha }}.tar.gz
- name: Set tag
id: set_tag
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Set whl artifact name
id: set_name_whl
run: echo "artifact_name=pocket_ic-${{ steps.set_tag.outputs.tag }}-py3-none-any.whl" >> $GITHUB_OUTPUT
- name: Set whl artifact name
id: set_name_tar
run: echo "artifact_name=pocket_ic-${{ steps.set_tag.outputs.tag }}.tar.gz" >> $GITHUB_OUTPUT
- name: ls
run: echo `ls -la `
- name: move artifacs to dist
run: |
mkdir dist
cp *.whl dist/
cp *.tar.gz dist/
- name: upload artifacts to release page
uses: softprops/action-gh-release@master
with:
files: |
${{ steps.set_name_whl.outputs.artifact_name }}
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1