Skip to content

Commit

Permalink
Merge branch 'main' into fix-docker
Browse files Browse the repository at this point in the history
  • Loading branch information
gabalafou committed Sep 23, 2024
2 parents 8687fd7 + b7ee3ca commit d93e3a5
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 77 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/build.yml

This file was deleted.

8 changes: 6 additions & 2 deletions .github/workflows/javascript-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
pull_request:

jobs:
build:
js-tests:
runs-on: ubuntu-latest

strategy:
Expand All @@ -23,16 +23,20 @@ jobs:
steps:
- name: "Checkout repository 🛎"
uses: actions/checkout@v4

- name: "Set Yarn to correct version 📌"
run: corepack enable
- name: Setup Node.js ${{ matrix.node-version }}

- name: "Setup Node.js ${{ matrix.node-version }}"
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
# https://github.com/actions/setup-node?tab=readme-ov-file#caching-global-packages-data

- name: "Install dependencies 📦"
run: yarn install --immutable
# https://yarnpkg.com/cli/install#options

- name: "Run tests 🧪"
run: yarn test
130 changes: 108 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
name: Release conda-store-ui
name: "Build and maybe release conda-store-ui"

on:
# we want to make a release whenever a new tag is created
release:
types: [published]
push:
tags:
- "*"
branches: [main]
tags: ["*"]
pull_request:
branches:
- main
workflow_dispatch:

jobs:
call-build:
uses: conda-incubator/conda-store-ui/.github/workflows/build.yml@main
env:
FORCE_COLOR: "1"
PACKAGE_FILE: "conda-store-ui.tgz"

make-release:
jobs:
# always build and verify
build-application:
name: "Build conda-store-ui"
runs-on: ubuntu-latest
# ensure that the artifacts are available from the build job
needs: call-build

steps:
- name: "Checkout repository 🛎"
Expand All @@ -29,33 +35,113 @@ jobs:
node-version: "22.x"
registry-url: "https://registry.npmjs.org"
scope: "@conda-store-ui"
cache: "yarn"

- name: "Install dependencies 📦"
run: yarn

- name: "Lint code 🔎"
- name: "Lint code 🔍"
run: yarn eslint:check

- name: "Download webpack bundle 📦"
- name: "Build source code (library) 🏗"
run: yarn run build

- name: "Build source code (web app) 🏗"
# ensure we use the prod target to minimise assets
run: yarn run webpack:prod bundle

- name: "Generate package tarball 📦"
run: yarn pack --filename ${{ env.PACKAGE_FILE }}

- name: "Upload package tarball 📤"
uses: actions/upload-artifact@v4
with:
name: conda-store-ui-package
path: ${{ env.PACKAGE_FILE }}

verify-build:
name: "Verify conda-store-ui build"
runs-on: ubuntu-latest
needs: build-application

steps:
- name: "Checkout repository 🛎"
uses: actions/checkout@v4

- name: "Download build artefacts 📦"
uses: actions/download-artifact@v4
with:
name: webpack-bundle
path: dist/
name: conda-store-ui-package

- name: "Generate package tarball 📦"
run: yarn pack --filename conda-store-ui.tgz
# (setup-node workaround https://github.com/actions/setup-node/issues/763) otherwise the authentication fails for npmjs
- name: "Set npmjs scope"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm config delete @conda-store-ui:registry --location project
npm config set @conda-store-ui:registry 'https://registry.npmjs.org' --location project
npm config set //registry.npmjs.org/:_authToken '${NODE_AUTH_TOKEN}' --location project
- name: "Check publish (dry run) 📤"
run: |
echo "Publishing dry run..."
npm publish --verbose --access public ${{ env.PACKAGE_FILE }} --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

release-to-npmjs:
name: "Release conda-store-ui to npmjs 📦"
runs-on: ubuntu-latest
needs:
- build-application
- verify-build
if: github.repository_owner == 'conda-incubator' && github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')
# needed for attestations
permissions:
id-token: write
attestations: write
contents: read

steps:
- name: "Checkout repository 🛎"
uses: actions/checkout@v4

# Set registry in .npmrc and set up auth to read in from
# env.NODE_AUTH_TOKEN.
- name: "Set up Node.js 🧶"
uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
scope: "@conda-store-ui"

- name: "Download build artefacts 📦"
uses: actions/download-artifact@v4
with:
name: conda-store-ui-package

- name: "Set NPM scope" #(setup-node workaround https://github.com/actions/setup-node/issues/763)
# Create an attestation with GitHub to track build provenance
# More info: https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds
- name: "Attest Build Provenance ✨"
uses: actions/attest-build-provenance@v1
if: github.repository_owner == 'conda-incubator' && github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')
with:
subject-path: ${{ env.PACKAGE_FILE }}

# (setup-node workaround https://github.com/actions/setup-node/issues/763) otherwise the authentication fails for npmjs
- name: "Set npmjs scope"
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm config delete @conda-store-ui:registry --location project
npm config set @conda-store-ui:registry 'https://registry.npmjs.org' --location project
npm config set //registry.npmjs.org/:_authToken '${NPM_AUTH_TOKEN}' --location project
npm config set //registry.npmjs.org/:_authToken '${NODE_AUTH_TOKEN}' --location project
- name: "Check npmjs/conda-store-ui scope"
run: npm show

- name: "Publish to npm 📤"
run: |
echo "Publishing with tag ${{ env.GITHUB_REF_NAME }}"
npm publish --verbose --access public conda-store-ui.tgz
npm publish --verbose --access public ${{ env.PACKAGE_FILE }}
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,5 @@ static
!.yarn/sdks
!.yarn/versions
.pnp.*#

.bun.lockb
4 changes: 2 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
```

> [!IMPORTANT]
> You need to be logged in to the npmjs registry to publish the package.
> And have access to the conda-store npm namespace.
> You need to be logged in to the `npmjs` registry to publish the package.
> And have access to the `conda-store` npm namespace.

1. Perform a local dry run publish:

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@conda-store/conda-store-ui",
"version": "2024.9.1-dev",
"version": "2024.9.2-rc1",
"description": "UI elements for building a frontend for conda-store",
"homepage": "https://github.com/conda-incubator/conda-store-ui",
"bugs": {
Expand Down Expand Up @@ -146,4 +146,4 @@
"node": ">=20.0.0"
},
"packageManager": "[email protected]"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const RequestedPackageList = ({
</StyledAccordionSummary>
<StyledAccordionDetails sx={{ padding: 0 }}>
<TableContainer>
<Table sx={{ width: "420px", tableLayout: "fixed" }}>
<Table sx={{ width: "100%", tableLayout: "fixed" }}>
<TableHead>
<TableRow>
<TableCell sx={{ fontSize: "13px" }}>Package</TableCell>
Expand Down
4 changes: 2 additions & 2 deletions src/styles/StyledAccordionDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export const StyledAccordionDetails = styled(AccordionDetails, {
? `1px solid ${palette.secondary.light}`
: "1px solid #BCBFC4",
borderTop: "none",
borderRadius: styleType === "grayscale" ? "0px 0px 5px 5px" : "Opx",
overflowY: "scroll",
borderRadius: styleType === "grayscale" ? "0px 0px 5px 5px" : "0px",
overflowY: "auto",
"&::-webkit-scrollbar-thumb": {
backgroundColor: styleType === "grayscale" ? "#EBECEE" : "#DADCE0",
borderRadius: "5px",
Expand Down

0 comments on commit d93e3a5

Please sign in to comment.