Skip to content

Commit

Permalink
fix: prod release workflow, reading props of undefined (#1527)
Browse files Browse the repository at this point in the history
  • Loading branch information
meeh0w committed Jul 26, 2024
1 parent 76486a9 commit ee6ace6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main_branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ jobs:
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_BRANCH: main
RELEASE_TYPE: alpha
run: yarn run semantic-release
15 changes: 6 additions & 9 deletions .releaserc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
This file contains the configuration for semantic release, the library we use to tag the correct
semantic version numbers onto releases. We have two release paths, one on main and one on release branch.
In the code below we check the env variable RELEASE_BRANCH to decide what we should do. As of
In the code below we check the env variable RELEASE_TYPE to decide what we should do. As of
the time of this file semantic release does not support specifying a config file from their CLI,
so this is the only we can have dynamic configs based on branch.
To test run this file, first get a github token at https://github.com/settings/tokens
and add it to the GITHUB_TOKEN env variable then specify what branch you want to run (main or release) under RELEASE_BRANCH
and add it to the GITHUB_TOKEN env variable then specify what kind of release ou want to run (production or alpha) under RELEASE_TYPE
$ export GITHUB_TOKEN=<token>
$ export RELEASE_BRANCH=<main or release>
$ export RELEASE_TYPE=<production or alpha>
$ run yarn run semantic-release -d
Expand Down Expand Up @@ -100,7 +100,7 @@ const execSentryReleaseSetting = [
];

let plugins;
if (process.env && process.env.RELEASE_BRANCH === 'release') {
if (process.env && process.env.RELEASE_TYPE === 'production') {
plugins = [
commitAnalyzerSetting,
execSentryReleaseSetting,
Expand All @@ -120,10 +120,7 @@ if (process.env && process.env.RELEASE_BRANCH === 'release') {

module.exports = {
// define a main version release branch even though we are doing all releases from main
// this branch list gets overwritten in the production release Github Action
branches: [
'release',
{ name: 'main', prerelease: 'alpha'}
],
// this branch list gets overwritten in the production release Github Action
branches: ['release', { name: 'main', prerelease: 'alpha' }],
plugins,
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Network, NetworkEvents } from '../models';
export function networksUpdatedEventListener(
evt: ExtensionConnectionEvent<{
networks: Network[];
activeNetwork: Network;
activeNetwork?: Network;
favoriteNetworks: number[];
customNetworks: Record<number, Network>;
}>
Expand Down
2 changes: 1 addition & 1 deletion src/contexts/NetworkProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export function NetworkContextProvider({ children }: { children: any }) {
setNetworks(result.networks);
setNetwork((currentNetwork) => {
const newNetwork = result.activeNetwork ?? currentNetwork; // do not delete currently set network
networkChanged.dispatch(newNetwork.caipId);
networkChanged.dispatch(newNetwork?.caipId);

return newNetwork;
});
Expand Down

0 comments on commit ee6ace6

Please sign in to comment.