-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a workflow to build and optionally release the plugin. Fix - .config/webpack/webpack.config.ts - as it was failing on relative path Add makezip.js to make the zip bundles based on the package.json version number
- Loading branch information
Showing
5 changed files
with
10,354 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ "main", "build-test" ] | ||
workflow_dispatch: | ||
inputs: | ||
release: | ||
description: 'Make a release build' | ||
required: false | ||
type: boolean | ||
|
||
jobs: | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up yarn | ||
uses: DerYeger/yarn-setup-action@master | ||
with: | ||
node-version: 16.14.0 | ||
|
||
- name: Build yarn | ||
run: | | ||
yarn build | ||
pwd | ||
ls -la ./dist | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.20' | ||
|
||
- name: Build go | ||
run: | | ||
go run mage.go | ||
ls -la ./dist | ||
- name: Zip artifacts | ||
run: | | ||
yarn zip | ||
ls -la | ||
- uses: actions/upload-artifact@v3 | ||
name: Attatch artifacts to job | ||
with: | ||
name: sasesp-plugin-zip-files | ||
path: ./sasesp-plugin*.zip | ||
retention-days: 7 | ||
|
||
- name: Bump version and push tag | ||
if: startsWith(github.event.head_commit.message, 'release:') | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create a GitHub release | ||
if: startsWith(github.event.head_commit.message, 'release:') | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ steps.tag_version.outputs.new_tag }} | ||
name: Release ${{ steps.tag_version.outputs.new_tag }} | ||
body: ${{ steps.tag_version.outputs.changelog }} | ||
artifacts: "./sasesp-plugin*.zip" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
var zip = require('bestzip'); | ||
var packageJson = require('./package.json'); | ||
|
||
zip({ | ||
source: packageJson.name + '/*', | ||
destination: './' + packageJson.name + '-' + packageJson.version + '.zip' | ||
}).then(function() { | ||
console.log('Zip complete.'); | ||
}).catch(function(err) { | ||
console.error(err.stack); | ||
process.exit(1); | ||
}); | ||
|
||
zip({ | ||
source: packageJson.name + '-all' + '/*', | ||
destination: './' + packageJson.name + '-' + packageJson.version + '-all' + '.zip' | ||
}).then(function() { | ||
console.log('Zip complete.'); | ||
}).catch(function(err) { | ||
console.error(err.stack); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.