-
Notifications
You must be signed in to change notification settings - Fork 712
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into revert_rust_version_fixed
- Loading branch information
Showing
11 changed files
with
263 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,21 @@ env: | |
RUST_BACKTRACE: full | ||
|
||
jobs: | ||
# The 3 following build jobs are 90% copy-pasted and should be refactored using | ||
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action | ||
linux: | ||
runs-on: ubuntu-latest | ||
release: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macOS-latest, windows-latest] | ||
include: | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-musl | ||
name: release_linux.tar.gz | ||
- os: windows-latest | ||
target: x86_64-pc-windows-msvc | ||
name: release_windows.zip | ||
- os: macOS-latest | ||
target: x86_64-apple-darwin | ||
name: release_macos.tar.gz | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
|
@@ -22,108 +33,32 @@ jobs: | |
with: | ||
profile: minimal | ||
toolchain: nightly | ||
target: "x86_64-unknown-linux-musl" | ||
target: ${{ matrix.target }} | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release | ||
- run: | | ||
- name: Package | ||
shell: bash | ||
run: | | ||
mkdir massa && cd massa && mkdir massa-node && mkdir massa-client | ||
cp -v ../target/release/massa-node massa-node/massa-node | ||
cp -v ../target/release/massa-client massa-client/massa-client | ||
cp -rv ../massa-node/config massa-node/config | ||
cp -rv ../massa-node/base_config massa-node/base_config | ||
cp -rv ../massa-node/storage massa-node/storage | ||
cp -rv ../massa-client/base_config massa-client/base_config | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: release_linux | ||
path: massa/ | ||
|
||
windows: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: "recursive" | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: nightly | ||
target: "x86_64-pc-windows-gnu" | ||
override: true | ||
- uses: Swatinem/rust-cache@v1 | ||
- uses: actions-rs/cargo@v1 | ||
cd .. | ||
if [[ "${{ matrix.os }}" == "windows-latest" ]] | ||
then | ||
7z a ${{ matrix.name }} massa | ||
else | ||
tar czvf ${{ matrix.name }} massa | ||
fi | ||
cd - | ||
- name: Publish | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
command: build | ||
args: --release | ||
- run: | | ||
mkdir massa && cd massa && mkdir massa-node && mkdir massa-client | ||
cp -v ../target/release/massa-node massa-node/massa-node.exe | ||
cp -v ../target/release/massa-client massa-client/massa-client.exe | ||
cp -rv ../massa-node/config massa-node/config | ||
cp -rv ../massa-node/base_config massa-node/base_config | ||
cp -rv ../massa-node/storage massa-node/storage | ||
cp -rv ../massa-client/base_config massa-client/base_config | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: release_windows | ||
path: massa/ | ||
|
||
macos: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: massalabs/linux-ci | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: | | ||
export HOME=/root | ||
rustup update | ||
rustup default nightly | ||
rustup target add x86_64-apple-darwin | ||
cargo update | ||
rm -rf massa/* | ||
mkdir -p massa/massa-node/ | ||
CC=o64-clang CXX=o64-clang++ cargo build --release --target x86_64-apple-darwin | ||
cd massa/ | ||
mkdir massa-client | ||
cp -v ../target/x86_64-apple-darwin/release/massa-node ./massa-node/massa-node | ||
cp -rv ../massa-node/config ./massa-node/config | ||
cp -rv ../massa-node/base_config ./massa-node/base_config | ||
cp -rv ../massa-node/storage ./massa-node/storage | ||
cp -v ../target/x86_64-apple-darwin/release/massa-client ./massa-client/massa-client | ||
cp -rv ../massa-client/base_config ./massa-client/base_config | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: release_macos | ||
path: massa/ | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
needs: [linux, windows, macos] | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
name: release_macos | ||
path: release_macos | ||
- uses: actions/[email protected] | ||
with: | ||
name: release_windows | ||
path: release_windows | ||
- uses: actions/[email protected] | ||
with: | ||
name: release_linux | ||
path: release_linux | ||
- run: | | ||
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
tar -czvf massa_${RELEASE_VERSION}_linux.tar.gz release_linux | ||
tar -czvf massa_${RELEASE_VERSION}_windows.tar.gz release_windows | ||
tar -czvf massa_${RELEASE_VERSION}_macos.tar.gz release_macos | ||
- uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
release_linux.tar.gz | ||
release_darwin.tar.gz | ||
release_windows.tar.gz | ||
files: 'release_*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.