Skip to content

Commit

Permalink
[AXON-29] chore: initial setup of Github CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sdzh-atlassian committed Dec 2, 2024
1 parent 23d3e04 commit c5313dc
Show file tree
Hide file tree
Showing 6 changed files with 542 additions and 54 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build

on:
push:
branches:
- '*'

jobs:
build:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Run linter
run: npm run lint

- name: Run unit tests
run: npm run test

- name: Build the extension
run: npm run extension:package

46 changes: 46 additions & 0 deletions .github/workflows/release-nightly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release Nightly

on:
schedule:
- cron: '0 0 * * *'

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Replace package name
run: sed -i 's/atlascode/atlascode-nightly/g' package.json

# TODO if we want to publish this, just a different version is not enough
# We'd probably want to use a different id for the extension, too - e.g. atlascode-nightly
- name: Evaluate version
run: |
RELEASE_VERSION=$(./nightlyver.sh ${GITHUB_SHA}) && \
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV && \
echo "Using version '${RELEASE_VERSION}'"
- name: Set version
run: npm -no-git-tag-version --allow-same-version -f version $RELEASE_VERSION

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Run linter
run: npm run lint

- name: Run unit tests
run: npm run test

- name: Build the extension
run: npm run extension:package

# No publish actions here for the time being - let's get the builds going first
63 changes: 63 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Release

on:
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- name: Evaluate version
run: |
RELEASE_VERSION=${GITHUB_REF##*/v} && \
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV && \
echo "Using version '${RELEASE_VERSION}'"
- name: Set version
run: npm -no-git-tag-version --allow-same-version -f version $RELEASE_VERSION

- name: Install dependencies
run: npm install

- name: Run linter
run: npm run lint

- name: Run unit tests
run: npm run test

- name: Build the extension
run: npm run extension:package

# keeping this two stubbed until we're ready to release
# until then we might want to add tags without actually releasing
# (e.g. to enable rollbacks down the line)
# TODO after repo is public:
# * change baseContentUrl across the repo
# * remove `echo` stubs

- name: Publish the extension
run: |
npx vsce verify-pat -p ${{ secrets.VSCE_MARKETPLACE_TOKEN }}
# echo npx vsce publish \
# -p ${{ secrets.VSCE_MARKETPLACE_TOKEN }} \
# --baseContentUrl https://bitbucket.org/atlassianlabs/atlascode/src/main/ \
# --packagePath atlascode-${GITHUB_REF##*/v}.vsix
- name: Publish to OpenVSX
run: |
npx ovsx verify-pat -p ${{ secrets.OPENVSX_KEY }}
# echo npx ovsx publish \
# -p ${{ secrets.OPENVSX_KEY }} \
# "atlascode-${GITHUB_REF##*/v}.vsix"
48 changes: 0 additions & 48 deletions bitbucket-pipelines.yml

This file was deleted.

Loading

0 comments on commit c5313dc

Please sign in to comment.