Repository navigation
146 lines (130 loc) · 5.46 KB
/
Copy pathrelease.yml
File metadata and controls
146 lines (130 loc) · 5.46 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: release
on:
push:
tags:
- "*"
jobs:
build-coordinator-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build and push Docker images
# You may pin to the exact commit or the version.
# uses: docker/build-push-action@92e71463491f2d026a477188b8ad3a0fdd9d672c
uses: docker/build-push-action@v1.1.0
with:
# Username used to log in to a Docker registry. If not set then no login will occur
username: ${{ secrets.DOCKER_USERNAME }}
# Password or personal access token used to log in to a Docker registry. If not set then no login will occur
password: ${{ secrets.DOCKER_PASSWORD }}
# Server address of Docker registry. If not set then will default to Docker Hub
registry: docker.pkg.github.com
# Docker repository to tag the image with
repository: buaa-se-compiling/rurikawa/rurikawa-coordinator
# Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags
tags: latest
# Automatically tags the built image with the git reference as per the readme
tag_with_ref: true
# Automatically tags the built image with the git short SHA as per the readme
tag_with_sha: true
# Path to the build context
path: .
dockerfile: coordinator.Dockerfile
# Adds labels with git repository information to the built image
add_git_labels: true
build_args: CI=true
build-web-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build and push Docker images
# You may pin to the exact commit or the version.
# uses: docker/build-push-action@92e71463491f2d026a477188b8ad3a0fdd9d672c
uses: docker/build-push-action@v1.1.0
with:
# Username used to log in to a Docker registry. If not set then no login will occur
username: ${{ secrets.DOCKER_USERNAME }}
# Password or personal access token used to log in to a Docker registry. If not set then no login will occur
password: ${{ secrets.DOCKER_PASSWORD }}
# Server address of Docker registry. If not set then will default to Docker Hub
registry: docker.pkg.github.com
# Docker repository to tag the image with
repository: buaa-se-compiling/rurikawa/rurikawa-web
# Comma-delimited list of tags. These will be added to the registry/repository to form the image's tags
tags: latest
# Automatically tags the built image with the git reference as per the readme
tag_with_ref: true
# Automatically tags the built image with the git short SHA as per the readme
tag_with_sha: true
# Path to the build context
path: web
# Adds labels with git repository information to the built image
add_git_labels: true
build-args: CI=true
build-judger:
strategy:
matrix:
include:
# - os: ubuntu-latest
# artifact_name: rurikawa
# asset_name: rurikawa-linux-amd64-gnu
# # target_name: x86_64-unknown-linux-gnu
- os: ubuntu-latest
artifact_name: rurikawa
asset_name: rurikawa-linux-amd64-musl
target_name: x86_64-unknown-linux-musl
- os: ubuntu-latest
artifact_name: rurikawa.exe
target_name: x86_64-pc-windows-gnu
asset_name: rurikawa-windows-amd64.exe
- os: macos-latest
artifact_name: rurikawa
asset_name: rurikawa-macos-amd64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
# use latest stable toolchain
- uses: dtolnay/rust-toolchain@stable
- name: Build rust
if: ${{ matrix.target_name == 0 }}
run: |
cargo fetch
cargo build -p rurikawa-judger --frozen --release
- name: install musl tools
if: ${{ matrix.target_name == 'x86_64-unknown-linux-musl' }}
run: sudo apt update && sudo apt install musl musl-dev musl-tools
- name: install windows tools
if: ${{ matrix.target_name == 'x86_64-pc-windows-gnu' }}
run: sudo apt update && sudo apt install mingw-w64
- name: install libclang (ubuntu)
if: ${{ matrix.os=='ubuntu-latest' }}
run: sudo apt-get install pkg-config libclang1
- name: Install rust target
if: ${{ matrix.target_name != 0 }}
continue-on-error: true
run: rustup target add ${{ matrix.target_name }}
- name: Build rust (targeted)
if: ${{ matrix.target_name != 0 }}
run: |
cargo fetch
cargo build -p rurikawa-judger --frozen --release --target ${{ matrix.target_name }}
- uses: haya14busa/action-cond@v1
id: condval
with:
cond: ${{ matrix.target_name != 0 }}
if_true: target/${{matrix.target_name}}/release
if_false: target/release
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.condval.outputs.value }}/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
overwrite: true