fix: is dir #17
Workflow file for this run
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
name: CD | |
on: | |
push: | |
tags: | |
- TEST.* | |
workflow_dispatch: | |
env: | |
ACTIONS_RUNNER_DEBUG: true | |
ACTIONS_STEP_DEBUG: true | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: full | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
release: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
platform: [x86_64, arm64] | |
include: | |
- os: ubuntu-latest | |
platform: x86_64 | |
target: x86_64-unknown-linux-gnu | |
name: release_linux.tar.gz | |
- os: ubuntu-latest | |
platform: arm64 | |
target: aarch64-unknown-linux-gnu | |
name: release_linux_arm64.tar.gz | |
- os: windows-latest | |
platform: x86_64 | |
target: x86_64-pc-windows-gnu | |
name: release_windows.zip | |
- os: macOS-latest | |
platform: x86_64 | |
target: x86_64-apple-darwin | |
name: release_macos.tar.gz | |
- os: macOS-latest | |
platform: arm64 | |
target: aarch64-apple-darwin | |
name: release_macos_aarch64.tar.gz | |
exclude: | |
- os: windows-latest | |
platform: arm64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
- name: Package | |
shell: bash | |
run: | | |
mkdir massa && cd massa && mkdir massa-node && mkdir 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/config massa-client/config | |
cp -rv ../massa-client/base_config massa-client/base_config | |
cd .. | |
if [[ "${{ matrix.os }}" == "windows-latest" ]] | |
then | |
7z a massa_${{ matrix.name }} massa | |
else | |
tar czvf massa_${{ matrix.name }} massa | |
fi | |
cd - | |
- name: Publish massa artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
# Name of the artifact to upload. | |
# Optional. Default is 'artifact' | |
name: massa_artifacts_${{ matrix.name }} | |
path: | | |
massa_*.zip | |
massa_*.tar.gz | |
if-no-files-found: error | |
- name: Publish release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
massa_*.zip | |
massa_*.tar.gz | |
checksum: | |
needs: release | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
- name: Uncompress all artifacts | |
run: | | |
ls -al | |
# Define the temporary and release directories | |
tmp_dir="massa_tmp" | |
release_dir="massa_release" | |
# Create the temporary directory if it doesn't exist | |
mkdir -p "$tmp_dir" | |
# Move matching artifacts to the temporary directory | |
for file in massa_artifacts_*; do | |
mv "$file" "$tmp_dir/" | |
done | |
# Create the release directory if it doesn't exist | |
mkdir -p "$release_dir" | |
# Extract files from the temporary directory to the release directory | |
cd "$tmp_dir" || exit 1 # Move into the temporary directory | |
for file in *; do | |
if [[ -f "$file" ]]; then # Check if it's a file | |
if [[ "$file" == *.zip ]]; then | |
unzip "$file" -d "../$release_dir/" | |
elif [[ "$file" == *.tar.gz ]]; then | |
tar -xzf "$file" -C "../$release_dir/" | |
fi | |
fi | |
done | |
# Move back to the original directory and remove the temporary directory | |
cd .. | |
rm -rf "$tmp_dir" | |
- name: Generate checksums file | |
uses: jmgilman/actions-generate-checksum@v1 | |
with: | |
method: sha256 | |
patterns: | | |
massa_release/massa_*.zip | |
massa_release/massa_*.tar.gz | |
output: checksums.txt | |
- name: Publish checksums file | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
checksums.txt |