Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
feat: add github actions to test and build (#56)
Browse files Browse the repository at this point in the history
* chore: standard github actions
  • Loading branch information
randi274 authored Dec 12, 2022
1 parent b9fc1a5 commit e1f8999
Show file tree
Hide file tree
Showing 17 changed files with 4,077 additions and 5,746 deletions.
152 changes: 0 additions & 152 deletions .circleci/config.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/manualRelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Manual Release

on:
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.IDEE_GH_TOKEN }}
- name: Conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@d360fad3a42feca6462f72c97c165d60a02d4bf2
# overriding some of the basic behaviors to just get the changelog
with:
git-user-name: Release Bot
git-user-email: ${{ secrets.IDEE_GH_EMAIL }}
github-token: ${{ secrets.IDEE_GH_TOKEN }}
output-file: false
# always do the release, even if there are no semantic commits
skip-on-empty: false
tag-prefix: ''
- uses: notiz-dev/github-action-json-property@2192e246737701f108a4571462b76c75e7376216
id: packageVersion
with:
path: 'package.json'
prop_path: 'version'
- name: Create Github Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.IDEE_GH_TOKEN }}
with:
tag_name: ${{ steps.packageVersion.outputs.prop }}
release_name: ${{ steps.packageVersion.outputs.prop }}
11 changes: 11 additions & 0 deletions .github/workflows/onPushToMain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Version, Tag and Github Release

on:
push:
branches: [main]

jobs:
release:
uses: salesforcecli/github-workflows/.github/workflows/githubRelease.yml@gbockus/updateReleaseToIncludeTokenInput
secrets:
ALT_GITHUB_TOKEN: ${{ secrets.IDEE_GH_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/onRelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish

# when a github release happens, publish an npm package,
on:
release:
types: [released]
# support manual release
workflow_dispatch:
inputs:
tag:
description: tag that needs to publish
type: string
required: true
jobs:
npm:
uses: salesforcecli/github-workflows/.github/workflows/npmPublish.yml@main
with:
ctc: false
githubTag: ${{ github.event.release.tag_name || inputs.tag }}
secrets: inherit
26 changes: 26 additions & 0 deletions .github/workflows/slackNotify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Slack Notification for Github Actions

on:
workflow_run:
workflows:
- Push to main
- release
types:
- completed

jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Announce result
uses: slackapi/[email protected]
with:
payload: |
{
"text": "GitHub Actions Notification",
"event": "${{ github.event.workflow_run.name }}, run: ${{ github.event.workflow_run.html_url }}",
"repo": "${{ github.event.workflow_run.repository.name }}",
"result": "${{ github.event.workflow_run.conclusion }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.IDEE_RELEASE_ALERT_SLACK_WEBHOOK }}
8 changes: 8 additions & 0 deletions .github/workflows/testCommitExceptMain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Unit Tests
on:
push:
branches-ignore: [main]

jobs:
unit-tests:
uses: salesforcecli/github-workflows/.github/workflows/unitTest.yml@main
17 changes: 17 additions & 0 deletions .github/workflows/validatePR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Validate PR

on:
pull_request:
branches: [main]

jobs:
pr-validation:
uses: salesforcecli/github-workflows/.github/workflows/validatePR.yml@main
format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: yarn
- name: Check Format
run: yarn format
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Dev config folders
/.circleci
/.vscode
/docs
/src
Expand Down
18 changes: 7 additions & 11 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp

// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"dbaeumer.vscode-eslint"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [

]
}
// List of extensions which should be recommended for users of this workspace.
"recommendations": ["dbaeumer.vscode-eslint"],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
}
31 changes: 4 additions & 27 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,5 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Publish apex-tmLanguage",
"command": "./scripts/publish-workflow.sh",
"type": "shell",
"args": ["${input:circleCiId}", "${input:publishType}"]
},

],
"inputs": [
{
"id": "circleCiId",
"type": "promptString",
"description": "CircleCi Token"
},
{
"id": "publishType",
"type": "pickString",
"description": "Type of version to publish",
"options": ["minor", "patch", "major"],
"default": "minor"
}
]
}
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0"
}
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Salesforce Apex Language Grammar

[![CircleCI](https://circleci.com/gh/forcedotcom/apex-tmLanguage.svg?style=svg)](https://circleci.com/gh/forcedotcom/apex-tmLanguage)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

## Introduction
Expand All @@ -15,9 +14,9 @@ Development and setup of this project has not been tested for Windows OS. You ma

To **build and test** install Node.js do the following:

- Run `npm install` to install any dependencies.
- Run `gulp` to build.
- Run `npm run test` to run tests.
- Run `yarn install` to install any dependencies.
- Run `yarn run build` to build using gulp.
- Run `yarn run test` to run tests.

Output grammars are output in the `grammars/` directory.

Expand Down Expand Up @@ -54,7 +53,7 @@ The example-\* queries were taken from [Example SELECT clauses](https://develope

## Releasing

Tags on this repo get automatically published as a GitHub release and an NPM package through Travis CI.
Merges to main on this repo with commits of type 'feat' or 'fix' get automatically published as a GitHub release and an NPM package through Github Actions.

## Attribution

Expand Down
8 changes: 1 addition & 7 deletions docs/publishing.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# Publishing

This is a guide for publishing this package to the npm registry as `@salesforce/apex-tmlanguage`

## Steps

1. `npm install`
1. `npm run prepare`
1. `npm publish --access public` (FYI: By default, scoped packages are published with private visibility.)
Publishing happens automatically when a commit with the tag `feat` or `fix` is merged to main.
Loading

0 comments on commit e1f8999

Please sign in to comment.