Skip to content

Commit

Permalink
fix(github): add GitHub release Jobs to the release workflow
Browse files Browse the repository at this point in the history
These new Jobs create a GitHub release with Assets for each package
  • Loading branch information
masoudmanson committed Sep 6, 2023
1 parent 189da9c commit 57940f8
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 8 deletions.
45 changes: 42 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- prod

jobs:
# Job 1
release:
name: Release
runs-on: ubuntu-latest # Use the latest version of the Ubuntu runner environment
Expand Down Expand Up @@ -58,7 +59,7 @@ jobs:
# Step 8: Lerna Version
- name: Lerna Version
env:
GITHUB_TOKEN: ${{ secrets.SDS_LERNA_VERSION_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn version:ci

Expand All @@ -81,7 +82,6 @@ jobs:
- name: Checkout main
uses: actions/checkout@v3
with:
ssh-key: "${{ secrets.COMMIT_KEY }}"
ref: main

# Step 12: Reset promotion branch
Expand All @@ -106,7 +106,6 @@ jobs:
Thus, techniques like "pushing an empty commit" or "closing and reopening the PR" help unblock the process, making the PR no longer solely reliant on action-triggered events.
branch: main-promotion
base: main

# Step 14: Post breaking changes to a Slack channel
- name: Post breaking changes to a Slack channel
Expand All @@ -118,3 +117,43 @@ jobs:
channel: "#sci-design-system-breaking-changes"
config: .github/config/slack.yml
if: contains(toJson(github.event.commits.*.message), 'BREAKING CHANGE')

# Job 2
create-version-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
# Step 1: Check out the repository code
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0

# Step 2: Create a matrix of package versions and names
- name: Create Versions Matrix
id: set-matrix
run: |
matrix="["
for package_json in $(find ./packages -name package.json); do
version=$(jq -r .version "$package_json")
name=$(jq -r .name "$package_json")
matrix="${matrix}{\"name\":\"${name}\", \"version\":\"${version}\"},"
done
matrix="${matrix%,}" # Remove trailing comma
matrix="${matrix}]" # Close the JSON array
echo "matrix=${matrix}" >> $GITHUB_OUTPUT
# Job 3
create-github-release:
needs: create-version-matrix
runs-on: ubuntu-latest
strategy:
matrix:
cfg: ${{fromJson(needs.create-version-matrix.outputs.matrix)}}
steps:
# Step 1: Create a GitHub release for the latest version
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: "${{ matrix.cfg.name }}@${{ matrix.cfg.version }}"
5 changes: 1 addition & 4 deletions packages/components/src/core/Autocomplete/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@ const Autocomplete = <Multiple extends boolean | undefined = false>(
search={search}
value={multiple ? pendingValue : value}
getOptionDisabled={(option: DefaultAutocompleteOption) => {
return (
option.name === "Type: feature request" ||
option.name === "Type: documentation"
);
return option.name === "Type: feature request";
}}
{...props}
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/data-viz/src/core/HeatmapChart/storyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const COLORS = [
"rgb(255, 204, 255)",
"rgb(230, 230, 250)",
"rgb(255, 228, 196)",
"rgb(255, 99, 71)",
"rgb(255, 100, 71)",
"rgb(255, 140, 0)",
"rgb(0, 255, 127)",
"rgb(218, 165, 32)",
Expand Down

0 comments on commit 57940f8

Please sign in to comment.