-
Notifications
You must be signed in to change notification settings - Fork 0
172 lines (141 loc) · 5.08 KB
/
release.yml
File metadata and controls
172 lines (141 loc) · 5.08 KB
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
161
162
163
164
165
166
167
168
169
170
171
172
name: Build and publish packages
on:
push:
tags:
- "v*"
# Test workflow without atrifacts publication
- "test-release-*"
env:
CARGO_TERM_COLOR: always
jobs:
release-linux:
name: Release ${{ matrix.target }} package
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
cross: false
feature: ""
name: base
lib_name: "libdevrc_plugin_system_shell.so"
- target: x86_64-unknown-linux-musl
cross: false
feature: ""
name: base
lib_name: "libdevrc_plugin_system_shell.so"
env:
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig
OPENSSL_STATIC: 1
OPENSSL_DIR: /musl
PKG_CONFIG_ALLOW_CROSS: 1
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install musl tools and dependencies
run: |
sudo apt-get -y install musl-tools libssl-dev musl-dev gcc build-essential dpkg rpm pkg-config
- name: Prepare openssl for musl target
run: |
sudo ln -s /usr/include/x86_64-linux-gnu/asm /usr/include/x86_64-linux-musl/asm
sudo ln -s /usr/include/asm-generic /usr/include/x86_64-linux-musl/asm-generic
sudo ln -s /usr/include/linux /usr/include/x86_64-linux-musl/linux
sudo mkdir /musl
wget https://github.com/openssl/openssl/archive/OpenSSL_1_1_1f.tar.gz
tar zxvf OpenSSL_1_1_1f.tar.gz
cd openssl-OpenSSL_1_1_1f/
sudo chmod -R 777 /musl
CC="musl-gcc -fPIE -pie" ./Configure no-shared no-async --prefix=/musl --openssldir=/musl/ssl linux-x86_64
make depend
make -j$(nproc)
make install
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Cache cargo directories
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install target x86_64-unknown-linux-musl
run: |
rustup target add x86_64-unknown-linux-musl
- name: Build binary for target ${{ matrix.target }}
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.target }}
- name: Create archive ${{ matrix.target }}
run: |
rustup target add x86_64-unknown-linux-musl
cargo build --release ${{ matrix.feature }} --target ${{ matrix.target }}
mv target/${{ matrix.target }}/release/{{ matrix.lib_name }} ./{{ matrix.lib_name }}
chmod +x {{ matrix.lib_name }}
tar -czf devrc-plugin-system-shell-${{ matrix.target }}-${{ matrix.name }}.tar.gz {{ matrix.lib_name }}
- name: Generate Changelog ${{ matrix.target }}
run: echo "# Good things have arrived 1" > ${{ github.workflow }}-CHANGELOG.txt
- name: Publish ${{ matrix.target }}
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
body_path: ${{ github.workflow }}-CHANGELOG.txt
draft: true
prerelease: true
files: |
./devrc-*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-darwin:
name: Release darwin package "${{ matrix.name }}"
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-apple-darwin
cross: false
feature: ""
name: base
lib_name: "libdevrc_plugin_system_shell.dylib"
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Cache cargo directories
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# - name: Build binary for target ${{ matrix.target }}
# uses: actions-rs/cargo@v1
# with:
# command: build
# args: --release --target ${{ matrix.target }}
- name: Create archive ${{ matrix.target }}
run: |
cargo build --release ${{ matrix.feature }} --target ${{ matrix.target }}
mv target/${{ matrix.target }}/release/{{ matrix.lib_name }} ./{{ matrix.lib_name }}
chmod +x {{ matrix.lib_name }}
tar -czf devrc-plugin-system-shell-${{ matrix.target }}-${{ matrix.name }}.tar.gz devrc
- name: Publish ${{ matrix.target }}
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
draft: true
prerelease: true
files: ./devrc-*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}