Skip to content

Commit

Permalink
ci(main): update variables
Browse files Browse the repository at this point in the history
  • Loading branch information
treyturner committed Oct 7, 2024
1 parent c0c8bce commit 10a5dad
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/release-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release & Publish
name: Release

on:
push:
Expand All @@ -7,7 +7,7 @@ on:

jobs:
test-and-build:
name: Test & Build main
name: main
uses: ./.github/workflows/test-build.yaml
secrets: inherit
permissions:
Expand All @@ -24,25 +24,28 @@ jobs:
with:
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
- uses: actions/github-script@v7
id: get-packages-released
id: get-released-pkgs
env:
PATHS_RELEASED: ${{ steps.release.outputs.paths_released }}
PUBLISHABLE_PKGS: ${{ vars.PUBLISHABLE_PKGS }}
with:
script: |
const paths = JSON.parse(process.env.PATHS_RELEASED);
const result = paths.map(path => path.split('/')[1]);
return result;
const { PATHS_RELEASED, PUBLISHABLE_PKGS } = process.env;
const paths = JSON.parse(PATHS_RELEASED);
const pubs = JSON.parse(PUBLISHABLE_PKGS);
const pkgs = paths.map(path => path.split('/').at(1));
return pkgs.filter(pkg => pubs.includes(pkg));
outputs:
packages-released: ${{ steps.get-packages-released.outputs.result }}
pkgs-released: ${{ steps.get-released-pkgs.outputs.result }}

publish:
name: Publish
if: ${{ needs.release-please.outputs.packages-released != '[]' }}
if: ${{ needs.release-please.outputs.pkgs-released != '[]' }}
runs-on: ubuntu-latest
needs: [release-please]
strategy:
matrix:
package: ${{ fromJson(needs.release-please.outputs.packages-released) }}
package: ${{ fromJson(needs.release-please.outputs.pkgs-released) }}
defaults:
run:
working-directory: packages/${{ matrix.package }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test & Build PR
name: PR

on: [workflow_call, pull_request]

Expand All @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
package: ${{ fromJson(vars.PACKAGES) }}
package: ${{ fromJson(vars.TESTABLE_PKGS) }}
defaults:
run:
working-directory: packages/${{ matrix.package }}
Expand All @@ -35,7 +35,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
package: ${{ fromJson(vars.PACKAGES) }}
package: ${{ fromJson(vars.BUILDABLE_PKGS) }}
defaults:
run:
working-directory: packages/${{ matrix.package }}
Expand Down
4 changes: 1 addition & 3 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
"bump-patch-for-minor-pre-major": true,
"packages": {
"packages/api-client": {},
"packages/mocks-counterfact": {
"release-as": "0.0.1"
}
"packages/mocks-counterfact": {}
},
"changelog-sections": [
{ "type": "feat", "section": "Features", "hidden": false },
Expand Down

0 comments on commit 10a5dad

Please sign in to comment.