From 24f2c5615a16bc5e8a40c75c0f3ca97ed39cf916 Mon Sep 17 00:00:00 2001 From: Keshav Priyadarshi Date: Sat, 20 Dec 2025 00:03:21 +0530 Subject: [PATCH 1/2] Update supported ecosystem in README Signed-off-by: Keshav Priyadarshi --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d6f94c..3a385a9 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,18 @@ ## Currently Supported Ecosystems -- **nuget**: [https://www.nuget.org/](https://www.nuget.org/) +- **apk** +- **cargo** +- **composer** +- **conan** +- **cpan** +- **cran** +- **debain** +- **maven** +- **npm** +- **nuget** +- **pypi** +- **swift** ## Usage From 10dbc813ea8e223dfa39316e8f7f644a8149733f Mon Sep 17 00:00:00 2001 From: Keshav Priyadarshi Date: Sat, 20 Dec 2025 00:07:44 +0530 Subject: [PATCH 2/2] Add workflow to automate FST regeneration and release creation Signed-off-by: Keshav Priyadarshi --- .github/workflows/sync-purls.yml | 72 +++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-purls.yml b/.github/workflows/sync-purls.yml index 4e7304f..c29248f 100644 --- a/.github/workflows/sync-purls.yml +++ b/.github/workflows/sync-purls.yml @@ -1,4 +1,4 @@ -name: Collect latest PURLs from FederatedCode +name: Collect latest PURLs from FederatedCode and create release with latest FST on: workflow_dispatch: @@ -11,7 +11,7 @@ permissions: jobs: collect-purls: strategy: - max-parallel: 4 + max-parallel: 1 matrix: include: - ecosystem: apk @@ -31,3 +31,71 @@ jobs: with: ecosystem: ${{ matrix.ecosystem }} path: "fst_builder/data/${{ matrix.ecosystem }}.txt" + + regen-fst-and-release: + name: Regenerate FST and create release using new FST + needs: collect-purls + runs-on: ubuntu-latest + steps: + - name: Checkout source + uses: actions/checkout@v4 + with: + token: ${{ secrets.GH_TAG_RELEASE_TOKEN }} + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Install cargo-edit + run: cargo install cargo-edit + + - name: Regenerate FST + id: regen_fst + run: |- + git pull + make build-fst + git diff --name-only | grep -q 'purls.fst' && echo "changed=true" >> $GITHUB_OUTPUT \ + || echo "changed=false" >> $GITHUB_OUTPUT + + # Commit latest FST + git config user.name "AboutCode Automation" + git config user.email "automation@aboutcode.org" + git add purls.fst + git commit -m "$(echo -e "Regenerate FST using latest PURLs\n\nSigned-off-by: AboutCode Automation ")" || exit 0 + git push + + - name: Bump minor version + id: bump + if: steps.regen_fst.outputs.changed == 'true' + run: |- + output=$(cargo set-version --bump minor 2>&1) + new_version=$(echo "$output" | awk '{print $NF}') + + echo "new_version=$new_version" >> $GITHUB_OUTPUT + + - name: Add Changelog + if: steps.regen_fst.outputs.changed == 'true' + run: |- + # Add Changelog + today=$(date +%Y-%m-%d) + awk -v ver="${{ steps.bump.outputs.new_version }}" -v date="$today" ' + NR==1{ + print "# Changelog\n\n## v" ver " (" date ")\n\n - Update FST with latest PURLs" + next + }1' CHANGELOG.md > .tmp.CHANGELOG.md && mv .tmp.CHANGELOG.md CHANGELOG.md + + - name: Commit Changelog and Lock files + if: steps.regen_fst.outputs.changed == 'true' + run: |- + # Commit Changelog and Lock files + git config user.name "AboutCode Automation" + git config user.email "automation@aboutcode.org" + git add -A + git commit -m "$(echo -e "Bump version for v${{ steps.bump.outputs.new_version }} release\n\nSigned-off-by: AboutCode Automation ")" || exit 0 + git push + + - name: Push tag + if: steps.regen_fst.outputs.changed == 'true' + run: |- + # Push tag + git tag -a "v${{ steps.bump.outputs.new_version }}" -m "Release v${{ steps.bump.outputs.new_version }}" + git push origin "v${{ steps.bump.outputs.new_version }}"