Skip to content

Commit

Permalink
Merge branch 'v4' of https://github.com/rokucommunity/roku-deploy int…
Browse files Browse the repository at this point in the history
…o remove-retainStagingFolder
  • Loading branch information
TwitchBronBron committed Dec 1, 2023
2 parents 2e31ad4 + d4c1583 commit 8a80323
Show file tree
Hide file tree
Showing 9 changed files with 405 additions and 63 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ module.exports = {
'no-underscore-dangle': 'off',
'no-unneeded-ternary': 'off',
'no-useless-escape': 'off',
'no-void': 'off',
'no-warning-comments': 'off',
'object-curly-spacing': 'off',
'object-property-newline': 'off',
Expand Down Expand Up @@ -178,4 +179,4 @@ module.exports = {
}
],
ignorePatterns: ['types']
};
};
57 changes: 57 additions & 0 deletions .github/workflows/create-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: create-package
on:
pull_request:
types: [labeled, unlabeled, synchronize]
jobs:
create-package:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'create-package')
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: "14.19.0"
# Get a bot token so the bot's name shows up on all our actions
- name: Get Token From roku-ci-token Application
uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.BOT_APP_ID }}
private_key: ${{ secrets.BOT_PRIVATE_KEY }}
- run: echo "TOKEN=${{ steps.generate-token.outputs.token }}" >> $GITHUB_ENV
- name: Compute variables
run: |
CURRENT_VERSION=$(grep -o '\"version\": *\"[^\"]*\"' package.json | awk -F'\"' '{print $4}')
SANITIZED_BRANCH_NAME=$(echo "$GITHUB_HEAD_REF" | sed 's/[^0-9a-zA-Z-]/-/g')
BUILD_VERSION="$CURRENT_VERSION-$SANITIZED_BRANCH_NAME.$(date +%Y%m%d%H%M%S)"
NPM_PACKAGE_NAME=$(grep -o '\"name\": *\"[^\"]*\"' package.json | awk -F'\"' '{print $4}')
ARTIFACT_NAME=$(echo "$NPM_PACKAGE_NAME-$BUILD_VERSION.tgz" | tr '/' '-')
ARTIFACT_URL="${{ github.server_url }}/${{ github.repository }}/releases/download/v0.0.0-packages/${ARTIFACT_NAME}"
echo "BUILD_VERSION=$BUILD_VERSION" >> $GITHUB_ENV
echo "ARTIFACT_URL=$ARTIFACT_URL" >> $GITHUB_ENV
- run: npm ci
- run: npm version "$BUILD_VERSION" --no-git-tag-version
- run: npm pack

# create the release if not exist
- run: gh release create v0.0.0-packages --latest=false --prerelease --notes "catchall release for temp packages" -R ${{ github.repository }}
continue-on-error: true

# upload this artifact to the "packages" github release
- run: gh release upload v0.0.0-packages *.tgz -R ${{ github.repository }}

- name: Fetch build artifact
uses: actions/github-script@v7
with:
github-token: ${{ env.TOKEN }}
script: |
return github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "Hey there! I just built a new temporary npm package based on ${{ github.event.pull_request.head.sha }}. You can download it [here](${{ env.ARTIFACT_URL }}) or install it by running the following command: \n```bash\nnpm install ${{ env.ARTIFACT_URL }}\n```"
});
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0



## [3.11.1](https://github.com/rokucommunity/roku-deploy/compare/v3.11.0...v3.11.1) - 2023-11-30
### Fixed
- Wait for file stream to close before resolving promise ([#133](https://github.com/rokucommunity/roku-deploy/pull/133))



## [3.11.0](https://github.com/rokucommunity/roku-deploy/compare/v3.10.5...v3.11.0) - 2023-11-28
### Changed
- Add public function `normalizeDeviceInfoFieldValue` to normalize device-info field values ([#129](https://github.com/rokucommunity/roku-deploy/pull/129))
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ Here are the available options. The defaults are shown to the right of the optio
*NOTE:* If you override this "files" property, you need to provide **all** config values, as your array will completely overwrite the default.
- **retainStagingFolder?:** boolean = `false`
- **retainStagingDir?:** boolean = `false`
Set this to true to prevent the staging folder from being deleted after creating the package. This is helpful for troubleshooting why your package isn't being created the way you expected.

- **stagingDir?:** string = `` `${options.outDir}/.roku-deploy-staging` ``
Expand Down
34 changes: 32 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "roku-deploy",
"version": "3.11.0",
"version": "3.11.1",
"description": "Package and publish a Roku application using Node.js",
"main": "dist/index.js",
"scripts": {
Expand Down Expand Up @@ -41,6 +41,7 @@
"@types/micromatch": "^4.0.2",
"@types/mocha": "^9.0.0",
"@types/node": "^16.11.3",
"@types/q": "^1.5.8",
"@types/request": "^2.47.0",
"@types/sinon": "^10.0.4",
"@types/xml2js": "^0.4.5",
Expand All @@ -52,6 +53,7 @@
"eslint": "8.0.1",
"mocha": "^9.1.3",
"nyc": "^15.1.0",
"q": "^1.5.1",
"rimraf": "^2.6.2",
"sinon": "^11.1.2",
"source-map-support": "^0.5.13",
Expand Down
Loading

0 comments on commit 8a80323

Please sign in to comment.