-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (55 loc) · 1.7 KB
/
cross_comp_ubuntu.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Rust Cross Compile for Ubuntu Linux
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: write # Ensure this allows pushing tags and commits
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
component: rustfmt
- name: Install cross
run: cargo install cross
- name: Build for Ubuntu Linux (x86_64)
run: cross build --target x86_64-unknown-linux-gnu --release
- name: Create a new tag
id: tag
run: |
TAG="v$(date +'%Y%m%d%H%M%S')" # Example tag format: vYYYYMMDDHHMMSS
git tag $TAG
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
git push origin $TAG
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifact for Ubuntu Linux
uses: actions/upload-artifact@v3
with:
name: ubuntu-build
path: target/x86_64-unknown-linux-gnu/release/mif
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: target/x86_64-unknown-linux-gnu/release/mif
tag_name: ${{ steps.tag.outputs.TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload release assets
uses: softprops/action-gh-release@v1
with:
files: target/x86_64-unknown-linux-gnu/release/mif
tag_name: ${{ steps.tag.outputs.TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}