generated from emilk/eframe_template
-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (159 loc) · 6.39 KB
/
release.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
'on':
push:
tags:
- 'v*'
jobs:
version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
lfs: true
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- run: mkdir -p ./version
- run: git describe --tags "$(git rev-list --tags --max-count=1)" > ./version/version
- uses: actions/upload-artifact@master
with:
name: version
path: ./version/version
build:
needs:
- version
runs-on: '${{ matrix.os }}'
strategy:
matrix:
include:
- os: macos-latest
target: x86_64-apple-darwin
suffix: ''
- os: macos-14
target: aarch64-apple-darwin
suffix: ''
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
suffix: ''
- os: windows-latest
target: x86_64-pc-windows-msvc
suffix: .exe
steps:
- uses: actions/checkout@master
with:
lfs: true
- id: get_repository_name
run: echo "REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//")" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/download-artifact@master
with:
name: version
- id: get_version
run: echo "VERSION=$(cat ./version/version)" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/cache@master
with:
path: ~/.cargo/registry
key: '${{ runner.os }}-cargo-registry-${{ hashFiles(''**/Cargo.lock'') }}'
- uses: actions/cache@master
with:
path: ~/.cargo/git
key: '${{ runner.os }}-cargo-index-${{ hashFiles(''**/Cargo.lock'') }}'
- uses: actions/cache@master
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
env:
VERSION: '${{ steps.get_version.outputs.VERSION }}'
REPOSITORY_NAME: '${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}'
with:
command: build
args: '--release'
- uses: actions/upload-artifact@master
with:
name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-${{ matrix.target }}
path: ./target/release/easyeda_to_kicad_lib_ui${{ matrix.suffix }}
release:
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
lfs: true
- id: get_repository_name
run: echo "REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//")" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/download-artifact@master
with:
name: version
- run: ls -lah
- id: get_version
run: 'echo "VERSION=$(cat ./version)" >> $GITHUB_OUTPUT'
shell: bash
- uses: actions/download-artifact@master
with:
name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-unknown-linux-gnu
path: ./${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-unknown-linux-gnu/
- uses: actions/download-artifact@master
with:
name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-apple-darwin
path: ./${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-apple-darwin/
- uses: actions/download-artifact@master
with:
name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-aarch64-apple-darwin
path: ./${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-aarch64-apple-darwin/
- uses: actions/download-artifact@master
with:
name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-pc-windows-msvc
path: ./${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-pc-windows-msvc/
- run: ls -lah
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
tag_name: '${{ steps.get_version.outputs.VERSION }}'
release_name: 'Release ${{ steps.get_version.outputs.VERSION }}'
draft: false
prerelease: false
- uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
upload_url: '${{ steps.create_release.outputs.upload_url }}'
asset_path: ./${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-unknown-linux-gnu/easyeda_to_kicad_lib_ui
asset_name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-unknown-linux-gnu
asset_content_type: application/octet-stream
- uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
upload_url: '${{ steps.create_release.outputs.upload_url }}'
asset_path: ./${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-apple-darwin/easyeda_to_kicad_lib_ui
asset_name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-apple-darwin
asset_content_type: application/octet-stream
- uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
upload_url: '${{ steps.create_release.outputs.upload_url }}'
asset_path: ./${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-aarch64-apple-darwin/easyeda_to_kicad_lib_ui
asset_name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-aarch64-apple-darwin
asset_content_type: application/octet-stream
- uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
upload_url: '${{ steps.create_release.outputs.upload_url }}'
asset_path: ./${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-pc-windows-msvc/easyeda_to_kicad_lib_ui.exe
asset_name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-pc-windows-msvc.exe
asset_content_type: application/octet-stream