Skip to content

feat: copy from other env when creating #51

feat: copy from other env when creating

feat: copy from other env when creating #51

Workflow file for this run

on:
pull_request: {}
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
name: Release
jobs:
build:
strategy:
fail-fast: false
matrix:
# a list of all the targets
include:
- TARGET: x86_64-unknown-linux-gnu # tested in a debian container on a mac
OS: ubuntu-20.04
- TARGET: x86_64-apple-darwin # tested on a mac
OS: macos-14
- TARGET: aarch64-apple-darwin
OS: macos-14
name: Create Release ${{ github.event_name == 'pull_request' && '(dry-run)' }}
runs-on: ${{ matrix.OS }}
env:
TARGET: ${{ matrix.TARGET }}
OS: ${{ matrix.OS }}
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Cargo cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
./target
key: build-cargo-registry-${{matrix.TARGET}}
- name: Install and configure dependencies
run: |
# dependencies are only needed on ubuntu as that's the only place where
# we make cross-compilation
if [[ $OS =~ ^ubuntu.*$ ]]; then
sudo apt-get install -qq crossbuild-essential-arm64 crossbuild-essential-armhf
fi
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: $TARGET
- name: Generate the artifacts
run: cargo build --release --target $TARGET
- name: Move files
run: |
mkdir -p ./artifacts
mv ./target/$TARGET/release/molnctl ./artifacts/molnctl-$TARGET
- name: Create Release
if: github.event_name == 'push'
uses: softprops/action-gh-release@3198ee18f814cdf787321b4a32a26ddbf37acc52 # v2.0.3
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
name: Release ${{ github.ref_name }}
draft: true
prerelease: false
generate_release_notes: true
files: "artifacts/*"