Skip to content

Commit a2d74fa

Browse files
test workflow
1 parent 30bef63 commit a2d74fa

File tree

2 files changed

+68
-1
lines changed

2 files changed

+68
-1
lines changed

.github/workflows/release.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Release Rust Project
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build:
10+
name: Build for ${{ matrix.target }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
include:
15+
- os: ubuntu-latest
16+
target: x86_64-unknown-linux-gnu
17+
short: linux
18+
bin_suffix: ""
19+
- os: macos-latest
20+
target: x86_64-apple-darwin
21+
short: macos
22+
bin_suffix: ""
23+
- os: windows-latest
24+
target: x86_64-pc-windows-msvc
25+
short: windows
26+
bin_suffix: ".exe"
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
- name: Install Rust
32+
uses: dtolnay/rust-toolchain@stable
33+
with:
34+
targets: ${{ matrix.target }}
35+
36+
- name: Build binary
37+
run: cargo build --release --target ${{ matrix.target }}
38+
39+
- name: Rename binary
40+
run: |
41+
mkdir -p artifacts
42+
cp target/${{ matrix.target }}/release/css-linter${{ matrix.bin_suffix }} artifacts/
43+
shell: bash
44+
45+
- name: Upload artifact
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: css-linter-${{ matrix.short }}${{ matrix.bin_suffix }}
49+
path: artifacts/
50+
51+
release:
52+
name: Create Release
53+
needs: build
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Download all artifacts
57+
uses: actions/download-artifact@v4
58+
with:
59+
path: artifacts
60+
61+
- name: Create GitHub Release
62+
uses: softprops/action-gh-release@v2
63+
with:
64+
files: artifacts/**/*
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.vscode
22
target
3-
Cargo.lock
3+
Cargo.lock
4+
npm-package

0 commit comments

Comments
 (0)