@@ -79,130 +79,125 @@ jobs:
79
79
run : python -m pip install -r release/requirements.txt
80
80
shell : bash
81
81
82
- - name : Check release notes
82
+ - name : Update changelog
83
+ run : |
84
+ python -m scriv collect --add --version ${{ needs.details.outputs.version }}
85
+ git config user.name github-actions
86
+ git config user.email [email protected]
87
+ git commit -a -m "Update changelog for ${{ needs.details.outputs.tag }}"
88
+ git push
89
+ shell : bash
90
+
91
+ - name : Create release
83
92
run : |
84
93
echo "${{ needs.details.outputs.notes }}" > /tmp/release_notes.md
85
- cat /tmp/release_notes.md
86
-
87
- # - name: Update changelog
88
- # run: |
89
- # python -m scriv collect --add --version ${{ needs.details.outputs.version }}
90
- # git config user.name github-actions
91
- # git config user.email [email protected]
92
- # git commit -a -m "Update changelog for ${{ needs.details.outputs.tag }}"
93
- # git push
94
- # shell: bash
95
-
96
- # - name: Create release
97
- # run: |
98
- # echo ${{ needs.details.outputs.notes }} > /tmp/release_notes.md
99
- # gh release create ${{ needs.details.outputs.tag }} --draft --notes-file /tmp/release_notes.md
100
- # shell: bash
101
- # env:
102
- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103
-
104
- # # build:
105
- # # name: Build ${{ matrix.target }}
106
- # # needs: [details, release]
107
- # # runs-on: ${{ matrix.os }}
108
-
109
- # # strategy:
110
- # # fail-fast: false
111
- # # matrix:
112
- # # # https://doc.rust-lang.org/stable/rustc/platform-support.html
113
- # # # https://github.com/rust-embedded/cross#supported-targets
114
- # # # aarch64-apple-darwin (basically) requires macos-11 to be generally available.
115
- # # include:
116
- # # - target: x86_64-apple-darwin
117
- # # os: macos-latest
118
- # # use-cross: false
119
- # # - target: x86_64-unknown-linux-gnu
120
- # # os: ubuntu-latest
121
- # # use-cross: false
122
- # # - target: aarch64-unknown-linux-gnu
123
- # # os: ubuntu-latest
124
- # # use-cross: true
125
- # # - target: riscv64gc-unknown-linux-gnu
126
- # # os: ubuntu-latest
127
- # # use-cross: true
128
- # # - target: x86_64-unknown-netbsd
129
- # # os: ubuntu-latest
130
- # # use-cross: true
131
-
132
- # # steps:
133
- # # - uses: actions/checkout@v2
134
-
135
- # # # OS-specific
136
- # # - uses: actions/cache@v2
137
- # # with:
138
- # # path: ~/.cache/pip
139
- # # key: ${{ runner.os }}-pip-${{ hashFiles('release/requirements.txt') }}
140
- # # restore-keys: |
141
- # # ${{ runner.os }}-pip-
142
-
143
- # # - name: Install Python
144
- # # uses: actions/setup-python@v2
145
- # # with:
146
- # # python-version: 3.x
147
-
148
- # # - name: Install dependencies
149
- # # run: python -m pip install -r release/requirements.txt
150
- # # shell: bash
151
-
152
- # # - name: Install Rust toolchain
153
- # # uses: actions-rs/toolchain@v1
154
- # # with:
155
- # # toolchain: ${{ env.toolchain }}
156
- # # target: ${{ matrix.target }}
157
- # # override: true
158
- # # profile: minimal
159
-
160
- # # - name: Cargo build
161
- # # uses: actions-rs/cargo@v1
162
- # # with:
163
- # # toolchain: ${{ env.toolchain }}
164
- # # use-cross: ${{ matrix.use-cross }}
165
- # # command: build
166
- # # args: --release --target ${{ matrix.target }}
167
-
168
- # # - name: Strip binary
169
- # # if: ${{ !matrix.use-cross }}
170
- # # run: |
171
- # # du -h target/${{ matrix.target }}/release/py
172
- # # strip target/${{ matrix.target }}/release/py
173
- # # du -h target/${{ matrix.target }}/release/py
174
- # # shell: bash
175
-
176
- # # - name: Create tarball
177
- # # run: |
178
- # # TARBALL_PATH=`python -m release tarball --target ${{ matrix.target }}`
179
- # # du -h $TARBALL_PATH
180
- # # tar -tvf $TARBALL_PATH
181
- # # echo "tarball_path=$TARBALL_PATH" >> $GITHUB_ENV
182
- # # shell: bash
183
-
184
- # # - name: Upload tarball
185
- # # run: gh release upload ${{ needs.details.outputs.tag }} ${{ env.tarball_path }} --clobber
186
- # # shell: bash
187
- # # env:
188
- # # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
189
-
190
- # # publish:
191
- # # name: Publish to crates.io
192
- # # needs: release
193
- # # runs-on: ubuntu-latest
194
-
195
- # # steps:
196
- # # - uses: actions/checkout@v2
197
-
198
- # # - name: Install Rust toolchain
199
- # # uses: actions-rs/toolchain@v1
200
- # # with:
201
- # # toolchain: ${{ env.toolchain }}
202
- # # override: true
203
- # # profile: minimal
204
-
205
- # # - name: Publish
206
- # # run: cargo publish --locked
207
- # # env:
208
- # # CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
94
+ gh release create ${{ needs.details.outputs.tag }} --draft --notes-file /tmp/release_notes.md
95
+ shell : bash
96
+ env :
97
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
98
+
99
+ build :
100
+ name : Build ${{ matrix.target }}
101
+ needs : [details, release]
102
+ runs-on : ${{ matrix.os }}
103
+
104
+ strategy :
105
+ fail-fast : false
106
+ matrix :
107
+ # https://doc.rust-lang.org/stable/rustc/platform-support.html
108
+ # https://github.com/rust-embedded/cross#supported-targets
109
+ # aarch64-apple-darwin (basically) requires macos-11 to be generally available.
110
+ include :
111
+ - target : x86_64-apple-darwin
112
+ os : macos-latest
113
+ use-cross : false
114
+ - target : x86_64-unknown-linux-gnu
115
+ os : ubuntu-latest
116
+ use-cross : false
117
+ - target : aarch64-unknown-linux-gnu
118
+ os : ubuntu-latest
119
+ use-cross : true
120
+ - target : riscv64gc-unknown-linux-gnu
121
+ os : ubuntu-latest
122
+ use-cross : true
123
+ - target : x86_64-unknown-netbsd
124
+ os : ubuntu-latest
125
+ use-cross : true
126
+
127
+ steps :
128
+ - uses : actions/checkout@v2
129
+
130
+ # OS-specific
131
+ - uses : actions/cache@v2
132
+ with :
133
+ path : ~/.cache/pip
134
+ key : ${{ runner.os }}-pip-${{ hashFiles('release/requirements.txt') }}
135
+ restore-keys : |
136
+ ${{ runner.os }}-pip-
137
+
138
+ - name : Install Python
139
+ uses : actions/setup-python@v2
140
+ with :
141
+ python-version : 3.x
142
+
143
+ - name : Install dependencies
144
+ run : python -m pip install -r release/requirements.txt
145
+ shell : bash
146
+
147
+ - name : Install Rust toolchain
148
+ uses : actions-rs/toolchain@v1
149
+ with :
150
+ toolchain : ${{ env.toolchain }}
151
+ target : ${{ matrix.target }}
152
+ override : true
153
+ profile : minimal
154
+
155
+ - name : Cargo build
156
+ uses : actions-rs/cargo@v1
157
+ with :
158
+ toolchain : ${{ env.toolchain }}
159
+ use-cross : ${{ matrix.use-cross }}
160
+ command : build
161
+ args : --release --target ${{ matrix.target }}
162
+
163
+ - name : Strip binary
164
+ if : ${{ !matrix.use-cross }}
165
+ run : |
166
+ du -h target/${{ matrix.target }}/release/py
167
+ strip target/${{ matrix.target }}/release/py
168
+ du -h target/${{ matrix.target }}/release/py
169
+ shell : bash
170
+
171
+ - name : Create tarball
172
+ run : |
173
+ TARBALL_PATH=`python -m release tarball --target ${{ matrix.target }}`
174
+ du -h $TARBALL_PATH
175
+ tar -tvf $TARBALL_PATH
176
+ echo "tarball_path=$TARBALL_PATH" >> $GITHUB_ENV
177
+ shell : bash
178
+
179
+ - name : Upload tarball
180
+ run : gh release upload ${{ needs.details.outputs.tag }} ${{ env.tarball_path }} --clobber
181
+ shell : bash
182
+ env :
183
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
184
+
185
+ publish :
186
+ name : Publish to crates.io
187
+ needs : release
188
+ runs-on : ubuntu-latest
189
+
190
+ steps :
191
+ - uses : actions/checkout@v2
192
+
193
+ - name : Install Rust toolchain
194
+ uses : actions-rs/toolchain@v1
195
+ with :
196
+ toolchain : ${{ env.toolchain }}
197
+ override : true
198
+ profile : minimal
199
+
200
+ - name : Publish
201
+ run : cargo publish --locked
202
+ env :
203
+ CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
0 commit comments