Skip to content

Commit a7ca08f

Browse files
La0marco-c
authored andcommitted
Automate GitHub releases with task-boot (#48)
1 parent 42fcee0 commit a7ca08f

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

.taskcluster.yml

+67
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,70 @@ tasks:
5757
description: rust-code-analysis lint and test
5858
5959
source: ${repository}/raw/${head_rev}/.taskcluster.yml
60+
61+
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
62+
then:
63+
taskId: {$eval: as_slugid("build_release")}
64+
dependencies:
65+
- {$eval: as_slugid("lint_test_task")}
66+
created: {$fromNow: ''}
67+
deadline: {$fromNow: '2 hour'}
68+
provisionerId: proj-relman
69+
workerType: ci
70+
payload:
71+
maxRunTime: 3600
72+
image: "rust:buster"
73+
env:
74+
PROJECT_NAME: rust-code-analysis
75+
command:
76+
- "/bin/bash"
77+
- "-cx"
78+
- "git clone --recursive --quiet ${repository} &&
79+
cd rust-code-analysis &&
80+
git -c advice.detachedHead=false checkout ${head_rev} &&
81+
cargo build --release &&
82+
cd target/release &&
83+
tar -zvcf /build.tar.gz --transform 's,^,rust-code-analysis-linux-x86_64/,' rust-code-analysis"
84+
artifacts:
85+
public/rust-code-analysis-linux-x86_64.tar.gz:
86+
expires: {$fromNow: '2 weeks'}
87+
path: /build.tar.gz
88+
type: file
89+
metadata:
90+
name: rust-code-analysis release build
91+
description: rust-code-analysis release build
92+
93+
source: ${repository}/raw/${head_rev}/.taskcluster.yml
94+
95+
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
96+
then:
97+
$let:
98+
version: {$eval: 'head_branch[10:]'}
99+
in:
100+
taskId: {$eval: as_slugid("deploy_release")}
101+
dependencies:
102+
- {$eval: as_slugid("build_release")}
103+
created: {$fromNow: ''}
104+
deadline: {$fromNow: '2 hour'}
105+
provisionerId: proj-relman
106+
workerType: ci
107+
scopes:
108+
- secrets:get:project/relman/rust-code-analysis/deploy
109+
payload:
110+
features:
111+
taskclusterProxy: true
112+
maxRunTime: 3600
113+
image: "mozilla/taskboot:0.2.0"
114+
env:
115+
TASKCLUSTER_SECRET: project/relman/rust-code-analysis/deploy
116+
command:
117+
- taskboot
118+
- github-release
119+
- mozilla/rust-code-analysis
120+
- "${version}"
121+
- "--asset=rust-code-analysis-linux-x86_64.tar.gz:public/rust-code-analysis-linux-x86_64.tar.gz"
122+
metadata:
123+
name: "rust-code-analysis release publication ${version}"
124+
description: rust-code-analysis release publication on Github
125+
126+
source: ${repository}/raw/${head_rev}/.taskcluster.yml

0 commit comments

Comments
 (0)