Skip to content

Commit

Permalink
ci: enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
Dafnik committed Nov 6, 2023
1 parent 81cffec commit 853e280
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 56 deletions.
40 changes: 23 additions & 17 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,16 @@ jobs:
- name: build ${{ matrix.lib }}
run: pnpm exec nx build ${{ matrix.lib }}

- name: zip ${{ matrix.lib }}
run: cd ./dist/libs/ && zip -r "${{ matrix.lib }}.zip" ./${{ matrix.lib }} && cd -

- uses: actions/upload-artifact@v3
name: create ${{ matrix.lib }} artifact
with:
name: ${{ matrix.lib }}
path: ./dist/libs/${{ matrix.lib }}
path: ./dist/libs/${{ matrix.lib }}.zip
retention-days: 1


deploy-lib:
name: Deploy ${{ matrix.lib }} dev
needs: [ build-lib, test, changes ]
Expand All @@ -126,8 +128,6 @@ jobs:
matrix:
lib: ${{ fromJSON(needs.changes.outputs.libs) }}
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v3
with:
name: ${{ matrix.lib }}
Expand All @@ -136,13 +136,10 @@ jobs:
- name: dist lookup
run: cd dist && ls -la && cd -

- name: zip ${{ matrix.lib }}.zip
run: zip -r "${{ matrix.lib }}.zip" ./dist >> /dev/null

- name: copy build to release server
uses: garygrossgarten/github-action-scp@release
with:
local: ./${{ matrix.lib }}.zip
local: ./dist/${{ matrix.lib }}.zip
remote: /var/www/share/releases/${{ matrix.lib }}/${{ matrix.lib }}-dev.zip
host: ${{ secrets.RELEASES_SSH_HOST }}
port: ${{ secrets.RELEASES_SSH_PORT }}
Expand All @@ -166,46 +163,55 @@ jobs:
- name: build ${{ matrix.app }}
run: pnpm exec nx build ${{ matrix.app }}

- name: zip ${{ matrix.app }}
run: cd ./dist/apps/ && zip -r "${{ matrix.app }}.zip" ./${{ matrix.app }} && cd -

- uses: actions/upload-artifact@v3
name: create ${{ matrix.app }} artifact
with:
name: ${{ matrix.app }}
path: ./dist/apps/${{ matrix.app }}
path: ./dist/apps/${{ matrix.app }}.zip
retention-days: 1

bundle-apps:
name: Bundle app artifacts into one
needs: [ build-apps ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v3
name: Download table-demo
with:
name: dfx-bootstrap-table-demo
path: ./dist/bootstrap-table

- uses: actions/download-artifact@v3
name: Download icons-demo
with:
name: dfx-bootstrap-icons-demo
path: ./dist/bootstrap-icons

- uses: actions/download-artifact@v3
name: Download qrcode-demo
with:
name: dfx-qrcode-demo
path: ./dist/qrcode

- uses: actions/download-artifact@v3
name: Download playground
with:
name: playground
path: ./playground

- name: move playground in place
run: mv playground/* dist/
- name: unzip all
run: |
unzip dfx-bootstrap-table-demo.zip
unzip dfx-bootstrap-icons-demo.zip
unzip dfx-qrcode-demo.zip
unzip playground.zip
- name: move files in place
run: |
mkdir dist
mv playground/* dist/
mv dfx-bootstrap-table-demo dist
mv dfx-bootstrap-icons-demo dist
mv dfx-qrcode-demo dist
- name: dist lookup
run: cd dist && ls -la && du -hs && cd -
Expand Down
45 changes: 19 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,14 @@ jobs:
- name: build ${{ inputs.lib }}
run: pnpm exec nx build ${{ inputs.lib }}

- name: zip ${{ inputs.lib }}
run: cd ./dist/libs/ && zip -r "${{ inputs.lib }}.zip" ./${{ inputs.lib }} && cd -

- uses: actions/upload-artifact@v3
name: create ${{ inputs.lib }} artifact
with:
name: ${{ inputs.lib }}
path: ./dist/libs/${{ inputs.lib }}
path: ./dist/libs/${{ inputs.lib }}.zip
retention-days: 1

release-zip:
Expand All @@ -77,23 +80,17 @@ jobs:
- name: get ${{ inputs.lib }} version
id: get-version
shell: bash
run: |
echo "VERSION=$(node -p "require('./dist/package.json').version")" >> $GITHUB_OUTPUT
run: echo "VERSION=$(node -p "require('./dist/package.json').version")" >> $GITHUB_OUTPUT

- name: zip to ${{ inputs.lib }}-v${{ steps.get-version.outputs.VERSION }}.zip and ${{ inputs.lib }}-latest.zip
- name: set to versioned zip ${{ inputs.lib }}-v${{ steps.get-version.outputs.VERSION }}.zip and ${{ inputs.lib }}-latest.zip
shell: bash
run: |
mkdir releases
zip -r "${{ inputs.lib }}-latest.zip" ./dist >> /dev/null
zip -r "${{ inputs.lib }}-v${{ steps.get-version.outputs.VERSION }}.zip" ./dist >> /dev/null
mv "${{ inputs.lib }}-latest.zip" ./releases
mv "${{ inputs.lib }}-v${{ steps.get-version.outputs.VERSION }}.zip" ./releases
copy ./dist/${{ inputs.lib }}.zip ./releases/${{ inputs.lib }}-latest.zip
copy ./dist/${{ inputs.lib }}.zip ./releases/${{ inputs.lib }}-v${{ steps.get-version.outputs.VERSION }}.zip
- name: releases lookup
run: |
cd releases
ls -la
cd -
run: cd releases && ls -la && du -hs && cd -

- name: move zips to release server
uses: garygrossgarten/github-action-scp@release
Expand Down Expand Up @@ -125,21 +122,16 @@ jobs:
- name: get ${{ inputs.lib }} version
id: get-version
shell: bash
run: |
echo "VERSION=$(node -p "require('./dist/package.json').version")" >> $GITHUB_OUTPUT
run: echo "VERSION=$(node -p "require('./dist/package.json').version")" >> $GITHUB_OUTPUT

- name: zip to ${{ inputs.lib }}-v${{ steps.get-version.outputs.VERSION }}.zip
- name: set to versioned zip ${{ inputs.lib }}-v${{ steps.get-version.outputs.VERSION }}.zip
shell: bash
run: |
mkdir releases
zip -r "${{ inputs.lib }}-v${{ steps.get-version.outputs.VERSION }}.zip" ./dist >> /dev/null
mv "${{ inputs.lib }}-v${{ steps.get-version.outputs.VERSION }}.zip" ./releases
copy ./dist/${{ inputs.lib }}.zip ./releases/${{ inputs.lib }}-v${{ steps.get-version.outputs.VERSION }}.zip
- name: releases lookup
run: |
cd releases
ls -la
cd -
run: cd releases && ls -la && du -hs && cd -

- name: get only latest changelog
run: |
Expand Down Expand Up @@ -167,15 +159,16 @@ jobs:
name: ${{ inputs.lib }}
path: ./dist

- name: unzip
shell: bash
run: cd dist && unzip ${{ inputs.lib }}.zip && cd -

- name: dist lookup
shell: bash
run: |
cd dist
ls -la
cd -
run: cd dist/${{ inputs.lib }} && ls -la && du -hs && cd -

- name: publish to npm registry
run: |
cd dist/
cd dist/${{ inputs.lib }}/
npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_PUBLISH_TOKEN }}
npm publish
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/assets/favicons/mstile-150x150.png"/>
<square150x150logo src="/bootstrap-icons/assets/favicons/mstile-150x150.png"/>
<TileColor>#9f00a7</TileColor>
</tile>
</msapplication>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"short_name": "Bootstrap Icons",
"icons": [
{
"src": "/assets/favicons/android-chrome-192x192.png",
"src": "/bootstrap-icons/assets/favicons/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/assets/favicons/android-chrome-512x512.png",
"src": "/bootstrap-icons/assets/favicons/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dfx-qrcode-demo/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class AppComponent {
title: ['Qr-Code Image', [Validators.required]],
alt: ['Qr-Code Image', [Validators.required]],
imageEnabled: [true, [Validators.required]],
imageSrc: ['/assets/angular-logo.png', [Validators.required]],
imageSrc: ['/qrcode/assets/angular-logo.png', [Validators.required]],
imageWidth: [80, [Validators.required]],
imageHeight: [80, [Validators.required]],
});
Expand Down

0 comments on commit 853e280

Please sign in to comment.