Skip to content

Commit

Permalink
Add beta detection for publish gh-action
Browse files Browse the repository at this point in the history
  • Loading branch information
KikoCosmetics committed May 27, 2024
1 parent a92cbfc commit a0db172
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/npm-publish-github-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,21 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.3.0
node-version: 20.9.0
registry-url: https://registry.npmjs.org/
- run: npm i -g yarn
- run: yarn install --check-files
- run: npm run build
- run: npm publish
- script:
- pkgversion=$(node -p -e "require('./package.json').version")
- >-
if [[ $pkgversion == *"beta"* ]]; then
echo "BETA DETECTED"
npm run publish:beta
exit 1
else
npm run publish
exit 0
fi
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
55 changes: 55 additions & 0 deletions .idx/dev.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# To learn more about how to use Nix to configure your environment
# see: https://developers.google.com/idx/guides/customize-idx-env
{ pkgs, ... }: {
# Which nixpkgs channel to use.
channel = "stable-23.11"; # or "unstable"

# Use https://search.nixos.org/packages to find packages
packages = [
# pkgs.go
# pkgs.python311
# pkgs.python311Packages.pip
# pkgs.nodejs_20
# pkgs.nodePackages.nodemon
];

# Sets environment variables in the workspace
env = {};
idx = {
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
extensions = [
# "vscodevim.vim"
];

# Enable previews
previews = {
enable = true;
previews = {
# web = {
# # Example: run "npm run dev" with PORT set to IDX's defined port for previews,
# # and show it in IDX's web preview panel
# command = ["npm" "run" "dev"];
# manager = "web";
# env = {
# # Environment variables to set for your server
# PORT = "$PORT";
# };
# };
};
};

# Workspace lifecycle hooks
workspace = {
# Runs when a workspace is first created
onCreate = {
# Example: install JS dependencies from NPM
# npm-install = "npm install";
};
# Runs when the workspace is (re)started
onStart = {
# Example: start a background task to watch and re-build backend code
# watch-backend = "npm run watch-backend";
};
};
};
}

0 comments on commit a0db172

Please sign in to comment.