version changes after build #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
| name: Publish Next Version | |
| on: | |
| push: | |
| branches: [master] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Install Node.js 12.x | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: 12.x | |
| registry-url: https://registry.npmjs.org/ | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v1 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: us-west-2 | |
| role-to-assume: ${{ secrets.AWS_ROLE_SANDBOX }} | |
| role-duration-seconds: 3600 | |
| role-skip-session-tagging: true | |
| - name: Install lib dependencies | |
| run: cd ./projects/dxc-ngx-cdk && rm -rf node_modules && npm install | |
| - name: Install app dependencies | |
| run: cd . && npm install | |
| - name: Generate lib | |
| run: cd ./projects/dxc-ngx-cdk && npm run generate-lib | |
| - name: Link lib | |
| run: cd . && npm run link-lib | |
| - name: Test library | |
| run: cd ./projects/dxc-ngx-cdk && npm run test | |
| - name: Build angular cdk site | |
| run: cd . && npm run build-next-cdk-site | |
| - name: Scully static angular cdk site | |
| run: cd . && npm run scully:next | |
| - name: Publish next to npm | |
| run: | | |
| sed -i "s#\"version\": \"0.0.0\"#\"version\": \"0.0.0-${GITHUB_SHA:0:7}\"#" ./dist/dxc-ngx-cdk/package.json | |
| cd ./dist/dxc-ngx-cdk | |
| npm publish --tag next --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} | |
| - name: Publish angular cdk site next version in S3 | |
| run: | | |
| aws s3 rm s3://design-system-angular-cdk-site/tools/angular/next/ --recursive | |
| aws s3 cp ./dist/static s3://design-system-angular-cdk-site/tools/angular/next/ --recursive |