Skip to content

Commit

Permalink
Use github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
interactivellama committed Oct 27, 2022
1 parent c6119e7 commit f793281
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/workflows/build-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# .github/workflows/build-heroku-app.yml // Just a comment
name: Build server
on:
push:
branches:
- master

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

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: 'master'
fetch-depth: '0'
- run: git config user.name github-actions
- run: git config user.email [email protected]
# - name: Setup node
# uses: actions/setup-node@v3
# with:
# node-version: 14
# - run: npm install --verbose
# - run: npm run build:npm-package
- name: Create Tag
id: create_tag
uses: jaywcjlove/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
package-path: ./package.json
# package-path: ./.tmp-npm/package.json
# - uses: JS-DevTools/npm-publish@v1
# with:
# token: ${{ secrets.NPM_TOKEN }}
# package: ./.tmp-npm/package.json
# access: restricted
# dry-run: true
# check-version: true
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "design-system-react",
"version": "0.10.48",
"version": "0.10.50-alpha.1",
"description": "Salesforce Lightning Design System for React",
"license": "BSD-3-Clause",
"engines": {
Expand All @@ -10,6 +10,7 @@
"build:docs": "npx babel-node ./scripts/build-docs.js",
"build:design-tokens": "rm -r ./utilities/design-tokens/dist/* && cp -R ./node_modules/@salesforce-ux/design-system/design-tokens/dist/*.js ./utilities/design-tokens/dist/",
"dist": "scripts/dist.sh",
"build:npm-package": "npm run icons && npm run build:docs && npm run dist && npx babel-node ./scripts/build-package.js",
"heroku-prebuild": "./scripts/heroku-prebuild.sh",
"heroku-postbuild": "export NPM_CONFIG_PRODUCTION=true; export NODE_ENV=production; ./scripts/heroku-postbuild.sh",
"icons": "npx babel-node scripts/inline-icons.js",
Expand All @@ -19,6 +20,7 @@
"lint:fix": "cross-env NODE_ENV=test npx prettier --write \"**/*.{js,jsx}\" && npx prettylint \"*.json\" --fix && npx eslint --fix \"**/*.{js,jsx,json}\" --max-warnings=0",
"lint:style": "npx concurrently \"npx prettier --list-different \"**/*.{js,jsx}\"\" \"npx prettylint \"*.json\"\"",
"lint:quality": "npx eslint \"**/*.{jsx,js,json}\" --max-warnings=0",
"npm:patch": "npm --no-git-tag-version version patch",
"prepare-components": "node ./scripts/prepare-components.js",
"publish:origin": "npx babel-node scripts/publish-to-git.js",
"publish:edge": "npx babel-node scripts/publish-to-git.js --tag=edge",
Expand Down
34 changes: 34 additions & 0 deletions scripts/build-package.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */

/* eslint-disable no-console, global-require */

import async from 'async';
import path from 'path';
import findRemoveSync from 'find-remove';
import exec from './command-line-utilities';

console.log('# Pruning package');
const rootPath = path.resolve(__dirname, '../');
const tmpDir = path.resolve(__dirname, '../.tmp-npm');
const gitDir = '.git';
const result = findRemoveSync(`${tmpDir}/components`, { dir: '__tests__' });
console.log('Removed the following test files:');
console.log(result);

const actions = [
{ command: 'git init', dir: tmpDir, rootPath },
{ command: `cp ${gitDir}/config ${tmpDir}/.git`, rootPath },
{ command: 'git add -A', dir: tmpDir, rootPath },
{
command: `git commit -m "Release commit for NPM package [ci skip]"`,
dir: tmpDir,
rootPath,
},
];

async.eachSeries(actions, exec, (err) => {
if (err) throw err;

console.log(`## Successfully commited git disconnected package folder.`);
});

0 comments on commit f793281

Please sign in to comment.