Skip to content

Release new version #89

Release new version

Release new version #89

Workflow file for this run

name: Release new version
on:
release:
types: [created]
permissions:
contents: write
jobs:
upload-versions:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Upload versions
uses: softprops/action-gh-release@v2
with:
files: versions.json
upload-assets:
strategy:
matrix:
include:
# Ubuntu
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
image: ubuntu:20.04
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
image: ubuntu:20.04
# Mac OS
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-apple-darwin
os: macos-13
# Windows
- target: x86_64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
container:
image: ${{ matrix.image || '' }}
options: --privileged
steps:
- name: Configure container
if: startsWith(matrix.os, 'ubuntu')
run: |
apt-get update
apt-get --no-install-recommends install -y build-essential ca-certificates curl git jq wget zip
mkdir -p -m 755 /etc/apt/keyrings
wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null
chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null
apt-get update
apt-get install gh -y
git config --global --add safe.directory $GITHUB_WORKSPACE
- uses: actions/checkout@v4
- name: Install Stable + Rustfmt + Clippy
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
# Set the current SHA as the version so that it's exposed on the server.
- name: Install cross-compilation tools
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target }}
if: startsWith(matrix.os, 'ubuntu')
- 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: Release the CLI
uses: taiki-e/upload-rust-binary-action@v1
with:
# (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload.
# Note that glob pattern is not supported yet.
bin: datadog-static-analyzer
# (optional) On which platform to distribute the `.tar.gz` file.
# [default value: unix]
# [possible values: all, unix, windows, none]
tar: none
# (optional) On which platform to distribute the `.zip` file.
# [default value: windows]
# [possible values: all, unix, windows, none]
zip: all
target: ${{ matrix.target }}
# (required) GitHub token for uploading assets to GitHub Releases.
token: ${{ secrets.GITHUB_TOKEN }}
archive: 'datadog-static-analyzer-$target'
- name: Release datadog-static-analyzer-git-hook
uses: taiki-e/upload-rust-binary-action@v1
with:
# (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload.
# Note that glob pattern is not supported yet.
bin: datadog-static-analyzer-git-hook
# (optional) On which platform to distribute the `.tar.gz` file.
# [default value: unix]
# [possible values: all, unix, windows, none]
tar: none
# (optional) On which platform to distribute the `.zip` file.
# [default value: windows]
# [possible values: all, unix, windows, none]
zip: all
target: ${{ matrix.target }}
# (required) GitHub token for uploading assets to GitHub Releases.
token: ${{ secrets.GITHUB_TOKEN }}
archive: 'datadog-static-analyzer-git-hook-$target'
- name: Release the server
uses: taiki-e/upload-rust-binary-action@v1
with:
# (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload.
# Note that glob pattern is not supported yet.
bin: datadog-static-analyzer-server
# (optional) On which platform to distribute the `.tar.gz` file.
# [default value: unix]
# [possible values: all, unix, windows, none]
tar: none
# (optional) On which platform to distribute the `.zip` file.
# [default value: windows]
# [possible values: all, unix, windows, none]
zip: all
target: ${{ matrix.target }}
# (required) GitHub token for uploading assets to GitHub Releases.
token: ${{ secrets.GITHUB_TOKEN }}
archive: 'datadog-static-analyzer-server-$target'