Skip to content
This repository has been archived by the owner on Feb 18, 2023. It is now read-only.

Commit

Permalink
Fix Update pre-release create new file
Browse files Browse the repository at this point in the history
  • Loading branch information
Faelayis committed May 28, 2022
1 parent df921cf commit 7946266
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 39 deletions.
3 changes: 1 addition & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
RPCPcStatus.plugin.js
RPCPcStatus.devlop.js
RPCPcStatus.plugin.js
55 changes: 30 additions & 25 deletions .github/workflows/publish_pre_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
id: bump_version
run: |
npm install -g version-bump-prompt
bump $bumprelease packagedev.json
bump $bumprelease ./pre-release/package.json
- name: Install Dependencies
run: npm install
Expand All @@ -75,33 +75,33 @@ jobs:
- uses: nyaa8/package-version@v1
id: package_version
with:
path: "./packagedev.json"
path: "./pre-release/package.json"
follow-symlinks: "false"

- name: Create Release
if: steps.package_version.outcome == 'success'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.PACKAGE_VERSION }}
release_name: ${{ env.PACKAGE_VERSION }}
body: "##### ${{ env.bumprelease }}"
draft: false
prerelease: true
# - name: Create Release
# if: steps.package_version.outcome == 'success'
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: v${{ env.PACKAGE_VERSION }}
# release_name: ${{ env.PACKAGE_VERSION }}
# body: "##### ${{ env.bumprelease }}"
# draft: false
# prerelease: true

- name: Upload Release Asset
if: steps.create_release.outcome == 'success'
id: upload_release_asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./RPCPcStatus.devlop.js
asset_name: RPCPcStatus.plugin.js
asset_content_type: text/javascript
# - name: Upload Release Asset
# if: steps.create_release.outcome == 'success'
# id: upload_release_asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./pre-release/RPCPcStatus.plugin.js
# asset_name: RPCPcStatus.plugin.js
# asset_content_type: text/javascript

- name: Automatically Commit Changed
if: steps.upload_release_asset.outcome == 'success'
Expand All @@ -114,3 +114,8 @@ jobs:
commit_user_email: [email protected]
commit_author: GitHub Actions <[email protected]>
skip_checkout: true

- name: Create/update tag
uses: rickstaa/action-create-tag@v1
with:
tag: v${{ env.PACKAGE_VERSION }}
3 changes: 1 addition & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
*.yml
RPCPcStatus.plugin.js
RPCPcStatus.devlop.js
RPCPcStatus.plugin.js
4 changes: 2 additions & 2 deletions bdbuilder.devlop.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"build": {
"watch": false,
"output": "./",
"output": "./pre-release",
"debug": true,
"filename": "RPCPcStatus.devlop.js"
"filename": "RPCPcStatus.plugin.js"
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"script:auth": "node ./script/authentication.js",
"script:releases": "node ./script/releases.js",
"publish_setup": "npm run script:releases && npm run npm-install && npm run prettier",
"script:publish_stable": " npm run publish_setup && npm run build && npm run build_dev && eslint ./RPCPcStatus.devlop.js ./RPCPcStatus.plugin.js --config .eslintrc.js --debug --fix",
"script:publish_prerelease": "npm run publish_setup && npm run build_dev && eslint ./RPCPcStatus.devlop.js --config .eslintrc.js --debug --fix && git checkout ./src/package.json"
"script:publish_stable": " npm run publish_setup && npm run build && npm run build_dev && eslint ./pre-release/RPCPcStatus.plugin.js ./RPCPcStatus.plugin.js --config .eslintrc.js --debug --fix",
"script:publish_prerelease": "npm run publish_setup && npm run build_dev && eslint ./pre-release/RPCPcStatus.plugin.js --config .eslintrc.js --debug --fix && git checkout ./src/package.json"
},
"repository": {
"type": "git",
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions script/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const fs = require("fs"),
ncu = require("npm-check-updates"),
core = require("@actions/core"),
editJsonFile = require("edit-json-file"),
package_directory = ["./../package.json", "./../packagedev.json", "./../src/package.json"],
package_directory = ["./../package.json", "./../pre-release/package.json", "./../src/package.json"],
semVer = new RegExp(
/(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?/gm,
);
Expand Down Expand Up @@ -40,9 +40,9 @@ try {
}
});
} else if (process.env.bumprelease) {
fs.readFile("RPCPcStatus.devlop.js", "utf8", async (err, data) => {
fs.readFile("./pre-release/RPCPcStatus.devlop.js", "utf8", async (err, data) => {
const version_old = await data.match(semVer)[0],
{ version } = require("../packagedev.json");
{ version } = require("../pre-release/package.json");
core.notice(`RPC Pc Status devlop pre release ${version_old} -> ${version}`);
core.info(`${process.env.bumpversion} Bump package version: ${version}`);
await editJsonFile(`${__dirname}/./../src/package.json`, {
Expand Down
2 changes: 1 addition & 1 deletion src/changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
"title": "Fixed",
"type": "fixed",
"items": ["Settings premid are reset on restart discord", "Features show premid not working"]
"items": ["Fix Update pre release create new file", "Settings premid are reset on restart discord", "Features show premid not working"]
},
{
"title": "Improved",
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const changelog = {
{
title: "Fixed",
type: "fixed",
items: ["Settings premid are reset on restart discord", "Features show premid not working"],
items: ["Fix Update pre release create new file", "Settings premid are reset on restart discord", "Features show premid not working"],
},
{
title: "Improved",
Expand Down Expand Up @@ -97,7 +97,7 @@ export default class Plugin {
ZLibrary.PluginUpdater.checkForUpdate?.(
"RPCPcStatus",
changelog.version,
"https://raw.githubusercontent.com/Faelayis/RPC-Pc-Status-BetterDiscord/main/RPCPcStatus.devlop.js",
"https://raw.githubusercontent.com/Faelayis/RPC-Pc-Status-BetterDiscord/main/pre-release/RPCPcStatus.plugin.js",
);
} else {
ZLibrary.PluginUpdater.checkForUpdate?.(
Expand Down

0 comments on commit 7946266

Please sign in to comment.