Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
68d4f6c
Fixing CI tests
derrickpersson Jul 13, 2022
f6fd0bd
Adding as build step instead
derrickpersson Jul 13, 2022
ad4e0aa
Secrets instead
derrickpersson Jul 13, 2022
93d8576
Env?
derrickpersson Jul 13, 2022
56da091
Deleting seperate workflow, adding steps into alpha package workflow
derrickpersson Jul 13, 2022
c8e002c
Fixing syntax, adding working dir
derrickpersson Jul 13, 2022
925b376
fixing more sytnax errors
derrickpersson Jul 13, 2022
f8b2573
Adding workdir
derrickpersson Jul 13, 2022
ff54ce4
build staging at root
derrickpersson Jul 13, 2022
f673b80
Fixing path, one more nested folder deep
derrickpersson Jul 13, 2022
f2576ca
explicitly running tests for vscode
derrickpersson Jul 13, 2022
e849596
Making tests a dependent workflow
derrickpersson Jul 13, 2022
b6d1707
Cleaning up CI variables
derrickpersson Jul 13, 2022
f7809c0
making them run in series
derrickpersson Jul 13, 2022
05a1cdf
Test always runs first, passing in packages token
derrickpersson Jul 13, 2022
57d1d7c
Updating other packaging workflow
derrickpersson Jul 13, 2022
95d521f
Adding publishing webview workflow
derrickpersson Jul 13, 2022
dab294c
Adding specific checkout for packages
derrickpersson Jul 13, 2022
a25370a
Reseting version
derrickpersson Jul 13, 2022
c6d0a18
Adding crucial information about repository to package.json to publis…
derrickpersson Jul 13, 2022
bdb8504
Merge branch 'development' into derrick/cod-1272-ci-action-to-publish…
derrickpersson Jul 14, 2022
07a6135
Adding NODE_AUTH_TOKEN
derrickpersson Jul 15, 2022
8feb0d9
Removing redundant step
derrickpersson Jul 15, 2022
fa2f19d
Not re-setting GITHUB TOKEN
derrickpersson Jul 18, 2022
0638f42
Setting GITHUB TOKEN
derrickpersson Jul 18, 2022
ff5f663
Updating package lock
derrickpersson Jul 18, 2022
55e1c75
Readding back the read packages token
derrickpersson Jul 18, 2022
98d46c8
Using PAT instead
derrickpersson Jul 18, 2022
73e4c28
Adding scope
derrickpersson Jul 18, 2022
dc5fc50
Removing slash
derrickpersson Jul 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/npm_publish_webview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Build and Package latest webview

on:
push:
branches:
- derrick/cod-1272-ci-action-to-publish-js-bundle-artifact
- 'releases/**'
- development

env:
NODE_ENV: ${{ secrets.NODE_ENV }}
FORCE_CLIENT_CHECK: ${{ secrets.FORCE_CLIENT_CHECK }}
API_URL: ${{ secrets.API_URL }}
PUSHER_AUTH_ENDPOINT: ${{ secrets.PUSHER_AUTH_ENDPOINT }}
PUSHER_APP_KEY: ${{ secrets.PUSHER_APP_KEY }}
PUSHER_CLUSTER: ${{ secrets.PUSHER_CLUSTER }}
SENTRY_DNS: ${{ secrets.SENTRY_DNS }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
LOG_MAX_FILE_SIZE: 5242880
LOG_MAX_FILES: 10
LOG_LEVEL: "debug"
POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }}
SEGMENT_KEY: ${{ secrets.SEGMENT_KEY }}

jobs:
test:
uses: ./.github/workflows/npm_ci_tests.yml
secrets:
CODEX_PUBLIC_KEY: ${{ secrets.CODEX_PUBLIC_KEY }}
CODEX_PRIVATE_KEY: ${{ secrets.CODEX_PRIVATE_KEY }}
READ_PACKAGES_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }}

build:
env:
NODE_AUTH_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }}
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://npm.pkg.github.com'
scope: "@usecodex"

- name: Install global packages
run: npm i -g rollup

- name: Install dependencies
run: npm ci --include=dev
working-directory: ./codex-webview
env:
GITHUB_TOKEN: ${{ secrets.READ_PACKAGES_TOKEN }}

- name: Configure git author
run: |
git --version
git config user.name "GitHub Actions Bot"
git config user.email "<>"

- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV

- name: Bump patch version to alpha
working-directory: ./codex-webview
run: npm version prerelease --preid="alpha-${SHORT_SHA}"

- name: Bump patch version to beta
if: github.ref == 'refs/heads/development'
working-directory: ./codex-webview
run: npm version prerelease --preid="beta-${SHORT_SHA}"

- name: Publish
working-directory: ./codex-webview
run: npm publish
2 changes: 1 addition & 1 deletion codex-webview/.npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@usecodex:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
//npm.pkg.github.com:_authToken=${GITHUB_TOKEN}
9 changes: 7 additions & 2 deletions codex-webview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@
"watch": "rollup -c -w",
"build:css": "tailwind build -i media/style.css -o out/style.css",
"build": "npm run build:css && rollup -c",
"test": "echo \"Error: TODO: Set up unit tests\" && exit 1"
"test": "echo \"Error: TODO: Set up unit tests\" && exit 1",
"prepublish": "npm run build"
},
"files": [
"out"
"out"
],
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
"repository": {
"type": "git",
"url": "git+https://github.com/usecodex/codex-vscode.git"
},
"keywords": [],
"devDependencies": {
"@fullhuman/postcss-purgecss": "^4.0.3",
Expand Down