Skip to content

Commit 65bd430

Browse files
committed
Update the release workflow
1 parent a045f53 commit 65bd430

File tree

5 files changed

+147
-146
lines changed

5 files changed

+147
-146
lines changed
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Package Rasberry Pi Release
2+
3+
inputs:
4+
arch:
5+
required: false
6+
target:
7+
required: true
8+
github_token:
9+
required: true
10+
11+
runs:
12+
using: composite
13+
steps:
14+
- uses: ./.github/actions/setup-arm
15+
with:
16+
arch: ${{ inputs.arch }}
17+
target: ${{ inputs.target }}
18+
19+
- name: Build
20+
shell: bash
21+
run: |
22+
cargo build --release --all --target ${{ inputs.target }} --features=raspberry
23+
24+
- name: Compress
25+
shell: bash
26+
run: |
27+
zip -j cargo-espflash-${{ inputs.target }}.zip target/${{ inputs.target }}/release/cargo-espflash
28+
zip -j espflash-${{ inputs.target }}.zip target/${{ inputs.target }}/release/espflash
29+
30+
- uses: svenstaro/upload-release-action@v2
31+
with:
32+
repo_token: ${{ inputs.github_token }}
33+
file: "*.zip"
34+
file_glob: true
35+
tag: ${{ github.ref }}

.github/actions/package/action.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Package Release
2+
3+
inputs:
4+
runs_on:
5+
required: true
6+
target:
7+
required: true
8+
github_token:
9+
required: true
10+
11+
runs:
12+
using: composite
13+
steps:
14+
- uses: dtolnay/rust-toolchain@stable
15+
with:
16+
target: ${{ inputs.target }}
17+
18+
- uses: Swatinem/rust-cache@v2
19+
20+
- name: Install dependencies
21+
if: ${{ inputs.runs_on == 'ubuntu-22.04' }}
22+
shell: bash
23+
run: |
24+
sudo apt-get install musl-tools libudev-dev
25+
26+
- name: Build
27+
shell: bash
28+
run: |
29+
cargo build --release --all --target ${{ inputs.target }}
30+
31+
- name: Compress (Unix)
32+
if: ${{ inputs.runs_on != 'windows-2022' }}
33+
shell: bash
34+
run: |
35+
zip -j cargo-espflash-${{ inputs.target }}.zip target/${{ inputs.target }}/release/cargo-espflash
36+
zip -j espflash-${{ inputs.target }}.zip target/${{ inputs.target }}/release/espflash
37+
38+
- name: Compress (Windows)
39+
if: ${{ inputs.runs_on == 'windows-2022' }}
40+
shell: bash
41+
run: |
42+
7z a -tzip cargo-espflash-${{ inputs.target }}.zip ./target/${{ inputs.target }}/release/cargo-espflash.exe
43+
7z a -tzip espflash-${{ inputs.target }}.zip ./target/${{ inputs.target }}/release/espflash.exe
44+
45+
- uses: svenstaro/upload-release-action@v2
46+
with:
47+
repo_token: ${{ inputs.github_token }}
48+
file: "*.zip"
49+
file_glob: true
50+
tag: ${{ github.ref }}

.github/workflows/package.yml

-51
This file was deleted.

.github/workflows/raspberry_package.yml

-66
This file was deleted.

.github/workflows/release.yml

+62-29
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,85 @@ on:
44
release:
55
types: [created]
66

7+
env:
8+
CARGO_TERM_COLOR: always
9+
710
jobs:
11+
# --------------------------------------------------------------------------
812
# Linux
913

1014
armv7-unknown-linux-gnueabihf:
11-
uses: ./.github/workflows/raspberry_package.yml
12-
with:
13-
target: armv7-unknown-linux-gnueabihf
14-
arch: armhf
15+
runs-on: ubuntu-22.04
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: ./.github/actions/package-arm
19+
with:
20+
arch: armhf
21+
target: armv7-unknown-linux-gnueabihf
22+
github_token: ${{ secrets.GITHUB_TOKEN }}
1523

1624
aarch64-unknown-linux-gnu:
17-
uses: ./.github/workflows/raspberry_package.yml
18-
with:
19-
target: aarch64-unknown-linux-gnu
20-
arch: arm64
25+
runs-on: ubuntu-22.04
26+
steps:
27+
- uses: actions/checkout@v3
28+
- uses: ./.github/actions/package-arm
29+
with:
30+
arch: arm64
31+
target: aarch64-unknown-linux-gnu
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
2133

2234
x86_64-unknown-linux-gnu:
23-
uses: ./.github/workflows/package.yml
24-
with:
25-
runs_on: ubuntu-20.04
26-
target: x86_64-unknown-linux-gnu
35+
runs-on: ubuntu-22.04
36+
steps:
37+
- uses: actions/checkout@v3
38+
- uses: ./.github/actions/package
39+
with:
40+
runs_on: ubuntu-22.04
41+
target: x86_64-unknown-linux-gnu
42+
github_token: ${{ secrets.GITHUB_TOKEN }}
2743

2844
x86_64-unknown-linux-musl:
29-
uses: ./.github/workflows/package.yml
30-
with:
31-
runs_on: ubuntu-20.04
32-
target: x86_64-unknown-linux-musl
45+
runs-on: ubuntu-22.04
46+
steps:
47+
- uses: actions/checkout@v3
48+
- uses: ./.github/actions/package
49+
with:
50+
runs_on: ubuntu-22.04
51+
target: x86_64-unknown-linux-musl
52+
github_token: ${{ secrets.GITHUB_TOKEN }}
3353

54+
# --------------------------------------------------------------------------
3455
# macOS
3556

3657
aarch64-apple-darwin:
37-
uses: ./.github/workflows/package.yml
38-
with:
39-
runs_on: macos-latest
40-
target: aarch64-apple-darwin
58+
runs-on: macos-12
59+
steps:
60+
- uses: actions/checkout@v3
61+
- uses: ./.github/actions/package
62+
with:
63+
runs_on: macos-12
64+
target: aarch64-apple-darwin
65+
github_token: ${{ secrets.GITHUB_TOKEN }}
4166

4267
x86_64-apple-darwin:
43-
uses: ./.github/workflows/package.yml
44-
with:
45-
runs_on: macos-latest
46-
target: x86_64-apple-darwin
68+
runs-on: macos-12
69+
steps:
70+
- uses: actions/checkout@v3
71+
- uses: ./.github/actions/package
72+
with:
73+
runs_on: macos-12
74+
target: x86_64-apple-darwin
75+
github_token: ${{ secrets.GITHUB_TOKEN }}
4776

77+
# --------------------------------------------------------------------------
4878
# Windows
4979

5080
x86_64-pc-windows-msvc:
51-
uses: ./.github/workflows/package.yml
52-
with:
53-
runs_on: windows-latest
54-
target: x86_64-pc-windows-msvc
55-
extension: .exe
81+
runs-on: windows-2022
82+
steps:
83+
- uses: actions/checkout@v3
84+
- uses: ./.github/actions/package
85+
with:
86+
runs_on: windows-2022
87+
target: x86_64-pc-windows-msvc
88+
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)