Skip to content

Commit

Permalink
Split dry run between nix and windows
Browse files Browse the repository at this point in the history
  • Loading branch information
sgb-io committed Jul 19, 2023
1 parent 808063a commit 58d0d5a
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ jobs:
name: macos-binaries
path: artifact/

- name: Download windows artifact
uses: actions/download-artifact@v2
with:
name: windows-binaries
path: artifact/

- name: Download linux artifact
uses: actions/download-artifact@v2
with:
Expand All @@ -40,9 +34,6 @@ jobs:
for file in artifact/*.tar.gz; do
tar -xzf "$file" -C packages/fta/binaries/
done
for file in artifact/*.7z; do
7z e "$file" -opackages/fta/binaries/ -aoa
done
- name: Install Verdaccio
run: npm install -g verdaccio verdaccio-auth-memory
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/publish-dry-run-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Publish NPM Package (Dry Run)

on: workflow_call

jobs:
publish_fta_cli_dry_run:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18

- name: Download windows artifact
uses: actions/download-artifact@v2
with:
name: windows-binaries
path: artifact/

- name: Extract artifacts
run: |
for file in artifact/*.7z; do
7z e "$file" -opackages/fta/binaries/ -aoa
done
- name: Install Verdaccio
run: npm install -g verdaccio verdaccio-auth-memory

- name: Setup Verdaccio Config
run: |
mkdir -p $HOME/.config/verdaccio
cp .github/verdaccio-config.yaml $HOME/.config/verdaccio/config.yaml
- name: Start Verdaccio
run: |
npx verdaccio --config $HOME/.config/verdaccio/config.yaml --listen 4873 &
sleep 10
- name: Publish package
run: |
echo "registry=http://localhost:4873" > .npmrc
echo "//localhost:4873/:_authToken=$(echo -n 'test:test' | base64)" >> .npmrc
cd packages/fta
npm publish --registry http://localhost:4873
cd ../
- name: Install and check package
run: |
npm install fta-cli --registry http://localhost:4873
# Execute fta via the npm package
fta-cli .github
8 changes: 6 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ jobs:
exit 1
fi
publish_dry_run:
publish_dry_run_nix:
needs: test_built_binaries
uses: ./.github/workflows/publish-dry-run.yml
uses: ./.github/workflows/publish-dry-run-nix.yml

publish_dry_run_windows:
needs: test_built_binaries
uses: ./.github/workflows/publish-dry-run-windows.yml

0 comments on commit 58d0d5a

Please sign in to comment.