|
1 | | -name: Release |
| 1 | +name: release |
2 | 2 |
|
3 | 3 | on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "stable" |
| 7 | + - "rc" |
| 8 | + - "v*.*.*" |
4 | 9 | workflow_dispatch: |
5 | 10 | inputs: |
6 | | - isNightly: |
| 11 | + is_nightly: |
7 | 12 | description: "Is this a nightly version or a release - Y or N" |
8 | 13 | type: string |
9 | 14 | required: true |
|
16 | 21 |
|
17 | 22 | env: |
18 | 23 | CARGO_TERM_COLOR: always |
19 | | - IS_NIGHTLY: ${{ inputs.isNightly == 'Y' }} |
| 24 | + IS_NIGHTLY: ${{ inputs.is_nightly == 'Y' }} |
20 | 25 | PROFILE: maxperf |
21 | 26 | STABLE_VERSION: ${{ inputs.version }} |
22 | | - TAG_NAME: stable |
23 | 27 |
|
24 | 28 | jobs: |
25 | 29 | prepare: |
26 | 30 | name: Prepare release |
27 | 31 | runs-on: ubuntu-latest |
28 | 32 | timeout-minutes: 30 |
29 | 33 | outputs: |
30 | | - tag_name: ${{ env.TAG_NAME }} |
| 34 | + tag_name: ${{ steps.release_info.outputs.tag_name }} |
31 | 35 | release_name: ${{ steps.release_info.outputs.release_name }} |
32 | 36 | changelog: ${{ steps.build_changelog.outputs.changelog }} |
33 | 37 | steps: |
|
42 | 46 | echo "tag_name=nightly-${GITHUB_SHA}" >> $GITHUB_OUTPUT |
43 | 47 | echo "release_name=Nightly ($(date '+%Y-%m-%d'))" >> $GITHUB_OUTPUT |
44 | 48 | else |
45 | | - echo "tag_name=${{ env.TAG_NAME }}" >> $GITHUB_OUTPUT |
46 | | - echo "release_name=${{ env.TAG_NAME }}" >> $GITHUB_OUTPUT |
| 49 | + echo "tag_name=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT |
| 50 | + echo "release_name=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT |
47 | 51 | fi |
48 | 52 |
|
49 | 53 | # Creates a `nightly-SHA` tag for this specific nightly |
|
54 | 58 | if: ${{ env.IS_NIGHTLY == 'true' }} |
55 | 59 | uses: actions/github-script@v7 |
56 | 60 | env: |
57 | | - TAG_NAME: ${{ env.TAG_NAME }} |
| 61 | + TAG_NAME: ${{ steps.release_info.outputs.tag_name }} |
58 | 62 | with: |
59 | 63 | script: | |
60 | 64 | const createTag = require('./.github/scripts/create-tag.js') |
|
66 | 70 | with: |
67 | 71 | configuration: "./.github/changelog.json" |
68 | 72 | fromTag: ${{ env.IS_NIGHTLY == 'true' && 'nightly' || env.STABLE_VERSION }} |
69 | | - toTag: ${{ env.TAG_NAME }} |
| 73 | + toTag: ${{ steps.release_info.outputs.tag_name }} |
70 | 74 | env: |
71 | 75 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
72 | 76 |
|
|
92 | 96 | svm_target_platform: linux-amd64 |
93 | 97 | platform: linux |
94 | 98 | arch: amd64 |
| 99 | + - runner: macos-14 |
| 100 | + target: x86_64-apple-darwin |
| 101 | + svm_target_platform: macosx-amd64 |
| 102 | + platform: darwin |
| 103 | + arch: amd64 |
| 104 | + - runner: macos-14 |
| 105 | + target: aarch64-apple-darwin |
| 106 | + svm_target_platform: macosx-aarch64 |
| 107 | + platform: darwin |
| 108 | + arch: arm64 |
| 109 | + - runner: windows-2022 |
| 110 | + target: x86_64-pc-windows-msvc |
| 111 | + svm_target_platform: windows-amd64 |
| 112 | + platform: win32 |
| 113 | + arch: amd64 |
95 | 114 | steps: |
96 | 115 | - uses: actions/checkout@v4 |
97 | 116 | - uses: dtolnay/rust-toolchain@stable |
@@ -125,17 +144,18 @@ jobs: |
125 | 144 | shell: bash |
126 | 145 | run: | |
127 | 146 | set -eo pipefail |
| 147 | + flags=(--target $TARGET --profile $PROFILE --bins |
| 148 | + --no-default-features --features aws-kms,cli,asm-keccak) |
128 | 149 |
|
129 | | - ext="" |
130 | | - [[ "$TARGET" == *windows* ]] && ext=".exe" |
131 | | -
|
132 | | - flags="--target $TARGET --profile $PROFILE --bins --no-default-features --features aws-kms,cli,asm-keccak" |
| 150 | + # `jemalloc` is not fully supported on MSVC or aarch64 Linux. |
133 | 151 | if [[ "$TARGET" != *msvc* && "$TARGET" != "aarch64-unknown-linux-gnu" ]]; then |
134 | | - flags="$flags --features jemalloc" |
| 152 | + flags+=(--features jemalloc) |
135 | 153 | fi |
136 | 154 |
|
| 155 | + [[ "$TARGET" == *windows* ]] && ext=".exe" |
| 156 | +
|
137 | 157 | if [[ "$TARGET" == "x86_64-unknown-linux-musl" ]]; then |
138 | | - docker run -v $PWD:/opt/revive messense/rust-musl-cross:x86_64-musl /bin/bash -c " |
| 158 | + docker run -v $PWD:/opt/revive messense/rust-musl-cross@sha256:5afc91a4f7da8a14a6c688ebf49fef9b9ec30f28fd827f2cf7e7c4d6c31bd10a:x86_64-musl /bin/bash -c " |
139 | 159 | cd /opt/revive |
140 | 160 | rustup target add x86_64-unknown-linux-musl |
141 | 161 | cargo build $flags |
@@ -228,58 +248,6 @@ jobs: |
228 | 248 | files: | |
229 | 249 | ${{ steps.artifacts.outputs.file_name }} |
230 | 250 | ${{ steps.man.outputs.foundry_man }} |
231 | | - |
232 | | - - name: Test Foundryup Musl Installation |
233 | | - shell: bash |
234 | | - env: |
235 | | - TARGET: ${{ matrix.target }} |
236 | | - run: | |
237 | | - if [[ "$TARGET" == "x86_64-unknown-linux-musl" ]]; then |
238 | | - docker run -v $PWD:/opt/revive messense/rust-musl-cross:x86_64-musl /bin/bash -c " |
239 | | - uname -s |
240 | | - uname -m |
241 | | - |
242 | | - # Install foundryup |
243 | | - curl -L https://raw.githubusercontent.com/soul022/foundry-revive-testing/refs/heads/master/foundryup/install | bash |
244 | | - |
245 | | - # Detect OS Type |
246 | | - OS_TYPE=$(uname -s) |
247 | | - if [[ "$OS_TYPE" == "Linux" ]]; then |
248 | | - FOUNDARY_BIN_PATH="$HOME/.config/.foundry/bin" |
249 | | - source "$HOME/.bashrc" || true # Load foundryup path if available |
250 | | - elif [[ "$OS_TYPE" == "Darwin" ]]; then |
251 | | - FOUNDARY_BIN_PATH="$HOME/.config/.foundry/bin" |
252 | | - [[ -f "$HOME/.zshrc" ]] && source "$HOME/.zshrc" || true # Fix MacOS path issues |
253 | | - [[ -f "$HOME/.bash_profile" ]] && source "$HOME/.bash_profile" || true |
254 | | - elif [[ "$OS_TYPE" == "MINGW"* || "$OS_TYPE" == "CYGWIN"* || "$OS_TYPE" == "MSYS"* ]]; then |
255 | | - FOUNDARY_BIN_PATH="$USERPROFILE/.foundry/bin" |
256 | | - export PATH="$FOUNDARY_BIN_PATH:$PATH" # Manually add it for Windows |
257 | | - else |
258 | | - echo "❌ Unsupported OS: $OS_TYPE" |
259 | | - exit 1 |
260 | | - fi |
261 | | - |
262 | | - # Ensure PATH is updated |
263 | | - echo "$FOUNDARY_BIN_PATH" >> $GITHUB_PATH |
264 | | - export PATH="$FOUNDARY_BIN_PATH:$PATH" |
265 | | - |
266 | | - # Determine installation version (stable or nightly) |
267 | | - if [[ "${{ env.IS_NIGHTLY }}" == "true" ]]; then |
268 | | - INSTALL_VERSION="nightly" |
269 | | - else |
270 | | - INSTALL_VERSION="stable" |
271 | | - fi |
272 | | - |
273 | | - # Run Foundry installation |
274 | | - foundryup --install "$INSTALL_VERSION" || echo "⚠️ Foundryup installation failed!" |
275 | | - |
276 | | - # Verify installation |
277 | | - which forge || echo "❌ forge binary not found in PATH" |
278 | | - which cast || echo "❌ cast binary not found in PATH" |
279 | | - |
280 | | - forge --version || echo "❌ forge command not available after install" |
281 | | - cast --version || echo "❌ cast command not available after install" |
282 | | - " |
283 | 251 |
|
284 | 252 | cleanup: |
285 | 253 | name: Release cleanup |
|
0 commit comments