Skip to content

(To revert) Test Windows build #98

(To revert) Test Windows build

(To revert) Test Windows build #98

Workflow file for this run

name: Release new version
on:
push:
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- { target: x86_64-pc-windows-msvc, os: windows-latest }
name: Build binaries for ${{ matrix.target }}
runs-on: ${{ matrix.os }}
container:
image: ${{ matrix.image || '' }}
options: --privileged
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rust-lang/[email protected]
with:
target: ${{ matrix.target }}
- name: Install cross-compilation tools
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target }}
# Set the current SHA as the version so that it's exposed on the server.
- name: Set the version
shell: bash
run: sed "s/development/$GITHUB_SHA/g" crates/static-analysis-kernel/src/constants.rs > bla && rm crates/static-analysis-kernel/src/constants.rs && mv bla crates/static-analysis-kernel/src/constants.rs
- name: Build Rust binaries
run: |
cargo build --release --target ${{ matrix.target }} --bin datadog-static-analyzer
cargo build --release --target ${{ matrix.target }} --bin datadog-static-analyzer-git-hook
cargo build --release --target ${{ matrix.target }} --bin datadog-static-analyzer-server
- name: Zip Rust binaries (Windows)
if: startsWith(matrix.os, 'windows')
run: |
cd target\${{ matrix.target }}\release
7z a datadog-static-analyzer-${{ matrix.target }}.zip datadog-static-analyzer.exe
7z a datadog-static-analyzer-git-hook-${{ matrix.target }}.zip datadog-static-analyzer-git-hook.exe
7z a datadog-static-analyzer-server-${{ matrix.target }}.zip datadog-static-analyzer-server.exe
move *.zip ..\..\..\
- name: Upload assets
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: |
datadog-static-analyzer-${{ matrix.target }}.zip
datadog-static-analyzer-git-hook-${{ matrix.target }}.zip
datadog-static-analyzer-server-${{ matrix.target }}.zip
if-no-files-found: error
retention-days: 7
release:
name: Release on GitHub
needs:
- build
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
release: ${{ steps.set-release.outputs.release }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Display structure of downloaded files
run: ls -lR
working-directory: artifacts
- name: Create pre-release
run: |-
gh release create --generate-notes --prerelease \
${{ github.ref_name }} \
versions.json \
artifacts/*/datadog-static-analyzer*.zip
env:
GH_TOKEN: ${{ github.token }}