-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from gludington/075datastructure
075datastructure
- Loading branch information
Showing
19 changed files
with
459 additions
and
294 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: conditional-visibility CI | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: npm install, build, and test | ||
run: npm install | ||
- name: Update Version | ||
shell: bash | ||
id: set-version | ||
run: echo "::set-output name=version::$(node .github/workflows/set-version.js ${{ github.ref }})" | ||
- run: npm run package | ||
- name: Create Release | ||
id: create_versioned_release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true | ||
name: Release ${{ steps.set-version.outputs.version }} | ||
draft: false | ||
prerelease: false | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
artifacts: './dist/module.json,./package/*.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,17 @@ | ||
var fs = require('fs'); | ||
const manifest = JSON.parse(fs.readFileSync('src/module.json', 'utf8')); | ||
// first argument is node, second is the filename of the script, third is the version we pass in our workflow. | ||
// expected tag format is 'refs/tags/v{major}.{minor}.{patch}" | ||
const tagVersion = process.argv[2].split('/').slice(-1)[0]; | ||
if (!tagVersion || !tagVersion.startsWith('v')) { | ||
console.error(`Invalid version specified: ${tagVersion}`); | ||
process.exitCode = 1; | ||
} else { | ||
manifest.version = tagVersion.substring(1); // strip the 'v'-prefix | ||
manifest.download = `https://github.com/gludington/conditional-visibility/releases/download/conditional-visibility-${tagVersion}.zip` | ||
manifest.manifest = `https://github.com/gludington/conditional-visibility/releases/download/${tagVersion}/module.json`, | ||
manifest.changelog= `https://github.com/gludington/conditional-visibility/blob/${tagVersion}/CHANGELOG.md`, | ||
manifest.readme = `https://github.com/gludington/conditional-visibility/blob/${tagVersion}/README.md`, | ||
fs.writeFileSync('src/module.json', JSON.stringify(manifest, null, 4)); // pretty print JSON back to module.json | ||
console.log(tagVersion); | ||
} |
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
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
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.