Skip to content

Commit

Permalink
chore(ci): ADding list of packages in the release assets
Browse files Browse the repository at this point in the history
  • Loading branch information
planctus committed Aug 14, 2023
1 parent 8ca22eb commit bb417ee
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,20 @@ jobs:
- name: Install zip
uses: montudor/action-zip@v1
- name: Create the package
run: |
zip -r -qq europa-component-library-${{ steps.tag.outputs.tag }}.zip .
ls -R
run: zip -r -qq europa-component-library-${{ steps.tag.outputs.tag }}.zip .
working-directory: dist/website

- name: Create the EC preset package
run: |
zip -r -qq ec-preset-${{ steps.tag.outputs.tag }}.zip .
ls -R
run: zip -r -qq ec-preset-${{ steps.tag.outputs.tag }}.zip .
working-directory: dist/packages/ec
- name: Create the EU preset package
run: |
zip -r -qq eu-preset-${{ steps.tag.outputs.tag }}.zip .
ls -R
run: zip -r -qq eu-preset-${{ steps.tag.outputs.tag }}.zip .
working-directory: dist/packages/eu
- name: Create the list of packages
run: sh ./scripts/packagesList.sh
- name: Deploy packages to github
uses: AButler/upload-release-assets@v2.0
with:
files: 'dist/website/europa-component-library-*.zip;dist/packages/europa-component-library-*-sri.json;dist/packages/ec/*.zip;dist/packages/eu/*.zip'
files: 'dist/website/europa-component-library-*.zip;dist/packages/europa-component-library-*-sri.json;dist/packages/ec/*.zip;dist/packages/eu/*.zip;ECL-npm-packages'
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ steps.tag.outputs.tag }}
- name: Build the archive
Expand Down
16 changes: 16 additions & 0 deletions scripts/packagesList.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Find all package.json files in the root directory and its subdirectories,
# excluding node_modules and only searching in @ecl/ directories

public_packages=$(find $(dirname "$root_dir") -type f -name "package.json" -not -path "*/node_modules/*" -exec grep -L '"private": true' {} + | xargs -I {} grep -o '"name": "[^"]*' {} | cut -d'"' -f4)
lerna_version=$(grep -o '"version": "[^"]*' "$(dirname "$root_dir")/lerna.json" | cut -d'"' -f4);

# Output the list of public packages and save it to a file in the root
output_file="$(dirname "$root_dir")/ECL-npm-packages"
echo "Public packages:" > "$output_file"
for package in $public_packages; do
echo "$package@$lerna_version" >> "$output_file"
done

echo "List of public packages saved to $output_file"

0 comments on commit bb417ee

Please sign in to comment.