Skip to content

Commit c5313dc

Browse files
[AXON-29] chore: initial setup of Github CI
1 parent 23d3e04 commit c5313dc

File tree

6 files changed

+542
-54
lines changed

6 files changed

+542
-54
lines changed

.github/workflows/build.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: 20
19+
cache: 'npm'
20+
21+
- name: Install dependencies
22+
run: npm install
23+
24+
- name: Run linter
25+
run: npm run lint
26+
27+
- name: Run unit tests
28+
run: npm run test
29+
30+
- name: Build the extension
31+
run: npm run extension:package
32+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release Nightly
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Replace package name
15+
run: sed -i 's/atlascode/atlascode-nightly/g' package.json
16+
17+
# TODO if we want to publish this, just a different version is not enough
18+
# We'd probably want to use a different id for the extension, too - e.g. atlascode-nightly
19+
- name: Evaluate version
20+
run: |
21+
RELEASE_VERSION=$(./nightlyver.sh ${GITHUB_SHA}) && \
22+
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV && \
23+
echo "Using version '${RELEASE_VERSION}'"
24+
25+
- name: Set version
26+
run: npm -no-git-tag-version --allow-same-version -f version $RELEASE_VERSION
27+
28+
- name: Set up Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 20
32+
cache: 'npm'
33+
34+
- name: Install dependencies
35+
run: npm install
36+
37+
- name: Run linter
38+
run: npm run lint
39+
40+
- name: Run unit tests
41+
run: npm run test
42+
43+
- name: Build the extension
44+
run: npm run extension:package
45+
46+
# No publish actions here for the time being - let's get the builds going first

.github/workflows/release.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: 20
19+
cache: 'npm'
20+
21+
- name: Evaluate version
22+
run: |
23+
RELEASE_VERSION=${GITHUB_REF##*/v} && \
24+
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV && \
25+
echo "Using version '${RELEASE_VERSION}'"
26+
27+
- name: Set version
28+
run: npm -no-git-tag-version --allow-same-version -f version $RELEASE_VERSION
29+
30+
- name: Install dependencies
31+
run: npm install
32+
33+
- name: Run linter
34+
run: npm run lint
35+
36+
- name: Run unit tests
37+
run: npm run test
38+
39+
- name: Build the extension
40+
run: npm run extension:package
41+
42+
# keeping this two stubbed until we're ready to release
43+
# until then we might want to add tags without actually releasing
44+
# (e.g. to enable rollbacks down the line)
45+
# TODO after repo is public:
46+
# * change baseContentUrl across the repo
47+
# * remove `echo` stubs
48+
49+
- name: Publish the extension
50+
run: |
51+
npx vsce verify-pat -p ${{ secrets.VSCE_MARKETPLACE_TOKEN }}
52+
# echo npx vsce publish \
53+
# -p ${{ secrets.VSCE_MARKETPLACE_TOKEN }} \
54+
# --baseContentUrl https://bitbucket.org/atlassianlabs/atlascode/src/main/ \
55+
# --packagePath atlascode-${GITHUB_REF##*/v}.vsix
56+
57+
- name: Publish to OpenVSX
58+
run: |
59+
npx ovsx verify-pat -p ${{ secrets.OPENVSX_KEY }}
60+
# echo npx ovsx publish \
61+
# -p ${{ secrets.OPENVSX_KEY }} \
62+
# "atlascode-${GITHUB_REF##*/v}.vsix"
63+

bitbucket-pipelines.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)