Skip to content
This repository was archived by the owner on Sep 17, 2023. It is now read-only.

Commit 91eab37

Browse files
authored
Merge pull request #6 from typescript-tools/beta
2 parents 49d60c7 + d00bf08 commit 91eab37

17 files changed

+12921
-12
lines changed

.cargo/config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[target.x86_64-apple-darwin]
2+
linker = "x86_64-apple-darwin14-clang"
3+
ar = "x86_64-apple-darwin14-ar"

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
indent_size = 2
6+
indent_style = space
7+
insert_final_newline = true
8+
max_line_length = 88
9+
10+
[*.rs]
11+
indent_size = 4

.github/workflows/release.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
name: Release
3+
4+
on:
5+
push:
6+
branches: [ master, alpha, beta ]
7+
8+
# semantic-release is built around the following idea:
9+
#
10+
# > A release consist in running test, defining the version then releasing
11+
#
12+
# - https://github.com/semantic-release/semantic-release/issues/753#issuecomment-384689034
13+
#
14+
# So we perform the following actions from the context of semantic-release plugins:
15+
#
16+
# - compile all target binaries
17+
# - docker build and publish
18+
# - npm publish
19+
# - create GitHub release
20+
21+
jobs:
22+
release:
23+
runs-on: ubuntu-latest
24+
env:
25+
BINARY_NAME: monorepo
26+
CARGO_TERM_COLOR: always
27+
RUST_BACKTRACE: 1
28+
steps:
29+
- name: Login to DockerHub
30+
uses: docker/login-action@v1
31+
with:
32+
username: ${{ secrets.DOCKER_USERNAME }}
33+
password: ${{ secrets.DOCKER_TOKEN }}
34+
35+
- name: Checkout
36+
uses: actions/checkout@v2
37+
38+
- name: Install macOS cross-compilation dependencies
39+
run: |
40+
sudo apt update
41+
sudo apt install --yes \
42+
g++ \
43+
gcc \
44+
libgmp-dev \
45+
libmpc-dev \
46+
libmpfr-dev \
47+
libssl-dev \
48+
libxml2-dev \
49+
zlib1g-dev
50+
51+
- name: Cache osxcross
52+
uses: actions/cache@v2
53+
id: cache-osxcross
54+
with:
55+
path: |
56+
~/osxcross
57+
key: ${{ runner.os }}-osxcross-${{ hashFiles('$GITHUB_WORKSPACE/ci/resource-macos-sdk') }}
58+
59+
- name: Install osxcross
60+
if: steps.cache-osxcross.outputs.cache-hit != 'true'
61+
run: |
62+
sdk=$(cat $GITHUB_WORKSPACE/ci/resource-macos-sdk)
63+
git clone https://github.com/tpoechtrager/osxcross ~/osxcross
64+
pushd ~/osxcross
65+
curl -O $sdk
66+
mv $(basename $sdk) tarballs/
67+
UNATTENDED=yes OSX_VERSION_MIN=10.7 ./build.sh
68+
popd
69+
70+
- name: Add macOS cross-compilation binaries to path
71+
run: echo "$HOME/osxcross/target/bin" >> $GITHUB_PATH
72+
73+
- name: Install GNU/Linux toolchain
74+
uses: actions-rs/toolchain@v1
75+
with:
76+
profile: minimal
77+
toolchain: stable
78+
target: x86_64-unknown-linux-gnu
79+
80+
- name: Install macOS toolchain
81+
uses: actions-rs/toolchain@v1
82+
with:
83+
toolchain: stable
84+
target: x86_64-apple-darwin
85+
86+
- name: Cache cargo
87+
uses: actions/cache@v2
88+
id: cache-cargo
89+
with:
90+
path: |
91+
~/.cargo/bin/
92+
~/.cargo/registry/index/
93+
~/.cargo/registry/cache/
94+
~/.cargo/git/db/
95+
target/
96+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
97+
98+
- name: Install semantic-release-rust
99+
uses: actions-rs/cargo@v1
100+
if: steps.cache-cargo.outputs.cache-hit != 'true'
101+
with:
102+
command: install
103+
args: semantic-release-rust --version 1.0.0-alpha.8
104+
105+
- name: Invoke semantic-release
106+
env:
107+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
109+
run: |
110+
npm ci --ignore-scripts
111+
npx semantic-release

.releaserc.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"branches": [
3+
"master",
4+
"alpha",
5+
"beta"
6+
],
7+
"plugins": [
8+
"@semantic-release/commit-analyzer",
9+
"@semantic-release/release-notes-generator",
10+
[
11+
"@semantic-release/exec",
12+
{
13+
"prepareCmd": "./ci/prepare-cmd ${nextRelease.version}"
14+
}
15+
],
16+
[
17+
"@codedependant/semantic-release-docker",
18+
{
19+
"dockerTags": [
20+
"latest",
21+
"{version}",
22+
"{major}-latest",
23+
"{major}.{minor}-latest"
24+
],
25+
"dockerImage": "hamroctopus/typescript-tools",
26+
"dockerProject": null,
27+
"dockerLogin": false
28+
}
29+
],
30+
"@semantic-release/npm",
31+
[
32+
"@semantic-release/github",
33+
{
34+
"assets": [
35+
{
36+
"path": "dist/typescript-tools-x86_64-unknown-linux-gnu.tar.gz",
37+
"label": "x86_64-unknown-linux-gnu"
38+
},
39+
{
40+
"path": "dist/typescript-tools-x86_64-apple-darwin.tar.gz",
41+
"label": "x86_64-apple-darwin"
42+
}
43+
]
44+
}
45+
]
46+
]
47+
}

0 commit comments

Comments
 (0)