fix(windows): statically link MSVC CRT to fix missing vcruntime140.dll issue #40
Workflow file for this run
This file contains hidden or 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: Release | |
on: | |
pull_request: | |
branches: [main] | |
types: [closed] | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
outputs: | |
version: ${{ steps.get-version.outputs.version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install cargo-make | |
run: cargo install cargo-make | |
- name: Build Windows | |
run: cargo make build | |
- name: Compress Windows Artifact | |
run: | | |
Compress-Archive -Path target/release/git-commit-analytics.exe -DestinationPath git-commit-analytics_win.zip | |
- name: Upload Windows Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows-build | |
path: git-commit-analytics_win.zip | |
build-mac: | |
runs-on: macos-latest | |
outputs: | |
version: ${{ steps.get-version.outputs.version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install cargo-make | |
run: cargo install cargo-make | |
- name: Build macOS | |
run: cargo make build | |
- name: Compress macOS Artifact | |
run: | | |
zip --junk-paths git-commit-analytics_mac.zip target/release/git-commit-analytics | |
- name: Upload macOS Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: mac-build | |
path: git-commit-analytics_mac.zip | |
release: | |
runs-on: ubuntu-latest | |
needs: [build-windows, build-mac] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install semantic-release and plugins | |
run: | | |
npm install -g semantic-release @semantic-release/changelog @semantic-release/git @semantic-release/github | |
- name: Download Windows Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: windows-build | |
path: artifacts/ | |
- name: Download macOS Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: mac-build | |
path: artifacts/ | |
- name: Prepare Assets | |
run: | | |
ls -lah artifacts/ | |
- name: Rename Artifacts with Version | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
run: | | |
VERSION=$(npx semantic-release --dry-run | grep -oP 'next release version is \K[0-9]+\.[0-9]+\.[0-9]+') | |
echo "Version detected: $VERSION" | |
mv artifacts/git-commit-analytics_win.zip artifacts/git-commit-analytics_v${VERSION}_win.zip | |
mv artifacts/git-commit-analytics_mac.zip artifacts/git-commit-analytics_v${VERSION}_mac.zip | |
- name: Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
run: | | |
semantic-release |