@@ -41,26 +41,106 @@ jobs:
41
41
- run : sudo apt-get install libdbus-1-dev libssl-dev libxdo-dev
42
42
- run : cargo clippy -- -D warnings
43
43
44
- release :
45
- needs : [check, fmt, clippy]
46
- name : Semantic Release
44
+ check- release :
45
+ needs : [ check, fmt, clippy ]
46
+ name : Check Release
47
47
runs-on : ubuntu-latest
48
48
if : github.actor != 'sbosnick-bot'
49
49
50
+ outputs :
51
+ new_release_published : ${{ steps.semantic.outputs.new_release_published }}
52
+ new_release_version : ${{ steps.semantic.outputs.new_release_version }}
53
+
50
54
steps :
51
55
- name : Checkout
52
56
uses : actions/checkout@v3
53
57
with :
54
58
fetch-depth : 0
55
59
persist-credentials : false
56
60
61
+ - name : Semantic Release
62
+ uses : cycjimmy/semantic-release-action@v4
63
+ env :
64
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
65
+ id : semantic
66
+ with :
67
+ dry_run : true
68
+
69
+ build :
70
+ needs : [ check-release ]
71
+ if : needs.check-release.outputs.new_release_published == 'true'
72
+ runs-on : ubuntu-latest
73
+
74
+ strategy :
75
+ matrix :
76
+ target : [ linux-x64, windows-x64 ]
77
+
78
+ steps :
79
+ - name : Checkout
80
+ uses : actions/checkout@v3
81
+
57
82
- name : Install Rust Stable
58
83
uses : dtolnay/rust-toolchain@stable
59
84
60
85
- run : sudo apt-get install libdbus-1-dev libssl-dev libxdo-dev
61
86
87
+ - name : Update version
88
+ run : |
89
+ sed -i '/\[package\]/,/^version = "[^"]*"$/ s/^version = "[^"]*"$/version = "'"${{ needs.check-release.outputs.new_release_version }}"'"/' Cargo.toml
90
+ cargo update --package vrc-osc-manager
91
+ shell : bash
92
+
93
+ - name : Build Binary
94
+ run : |
95
+ if [ "${{ matrix.target }}" == "linux-x64" ]; then
96
+ cargo build --release --target x86_64-unknown-linux-gnu
97
+ cp target/x86_64-unknown-linux-gnu/release/vrc-osc-manager ./vrc-osc-manager
98
+ else
99
+ cargo install cross --git https://github.com/rust-embedded/cross
100
+ cross build --release --target x86_64-pc-windows-gnu
101
+ cp target/x86_64-pc-windows-gnu/release/vrc-osc-manager.exe ./vrc-osc-manager.exe
102
+ shell : bash
103
+
104
+ - name : Upload Binary Artifact
105
+ uses : actions/upload-artifact@v3
106
+ with :
107
+ name : ${{ matrix.target }}-binary
108
+ path : |
109
+ ./vrc-osc-manager
110
+ ./vrc-osc-manager.exe
111
+
112
+ semantic-release :
113
+ needs : [ build ]
114
+ if : needs.check-release.outputs.new_release_published == 'true'
115
+ runs-on : ubuntu-latest
116
+
117
+ steps :
118
+ - name : Checkout
119
+ uses : actions/checkout@v3
120
+
121
+ - name : Install Rust Stable
122
+ uses : dtolnay/rust-toolchain@stable
123
+
124
+ - name : Download Binaries
125
+ uses : actions/download-artifact@v3
126
+ with :
127
+ name : linux-x64-binary
128
+ path : ./release-artifacts/
129
+
130
+ - name : Download Windows Binary
131
+ uses : actions/download-artifact@v3
132
+ with :
133
+ name : windows-x64-binary
134
+ path : ./release-artifacts/
135
+
136
+ - name : Update version
137
+ run : |
138
+ sed -i '/\[package\]/,/^version = "[^"]*"$/ s/^version = "[^"]*"$/version = "'"${{ needs.check-release.outputs.new_release_version }}"'"/' Cargo.toml
139
+ cargo update --package vrc-osc-manager
140
+ shell : bash
141
+
62
142
- name : Semantic Release
63
- uses : cycjimmy/semantic-release-action@v3
143
+ uses : cycjimmy/semantic-release-action@v4
64
144
env :
65
145
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
66
146
id : semantic
69
149
@semantic-release/[email protected]
70
150
@semantic-release/[email protected]
71
151
@semantic-release/[email protected]
152
+ @semantic-release/[email protected]
0 commit comments