fix: CDS-2533 - blob-to-otel fix storage account name (#94) #314
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
| name: Build & Release | |
| on: | |
| pull_request: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| inputs: | |
| package: | |
| description: 'Specify the package to release' | |
| required: true | |
| default: 'none' | |
| type: choice | |
| options: | |
| - "BlobViaEventGrid" | |
| - "DiagnosticData" | |
| # - "EventHub" | |
| - "StorageQueue" | |
| - "BlobToOtel" | |
| jobs: | |
| check: | |
| name: Check | |
| runs-on: ubuntu-latest | |
| outputs: | |
| packages: ${{ steps.packages.outputs.json }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get Changed Directories | |
| id: changed-dirs | |
| uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c | |
| with: | |
| files_ignore: | | |
| **/*.md | |
| .github/** | |
| .gitignore | |
| AUTHORS.md | |
| EventHub/** | |
| dir_names: true | |
| dir_names_max_depth: 1 | |
| json: true | |
| - name: Build packages JSON | |
| id: packages | |
| shell: bash | |
| run: | | |
| if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | |
| echo "json=[\"${{ inputs.package }}\"]" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "json=${{ steps.changed-dirs.outputs.all_changed_files }}" >> "$GITHUB_OUTPUT" | |
| fi | |
| build: | |
| if: needs.check.outputs.packages != '[]' | |
| runs-on: ubuntu-latest | |
| needs: [check] | |
| strategy: | |
| matrix: | |
| package: ${{ fromJSON(needs.check.outputs.packages) }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 20 | |
| - name: Install functools | |
| run: npm install -g azure-functions-core-tools@4 --unsafe-perm true | |
| - name: Install dependencies | |
| working-directory: ./${{ matrix.package }} | |
| run: npm install | |
| - name: Build | |
| working-directory: ./${{ matrix.package }} | |
| run: npm run build:production | |
| - name: Package | |
| if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch' }} | |
| working-directory: ./${{ matrix.package }} | |
| run: zip -r ${{ matrix.package }}.zip . -x ".*" | |
| - name: Setup AWS credentials | |
| if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch' }} | |
| uses: aws-actions/configure-aws-credentials@v1 | |
| with: | |
| aws-access-key-id: ${{ secrets.CS_DEVOPS_S3_AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.CS_DEVOPS_S3_AWS_SECRET_ACCESS_KEY }} | |
| aws-region: ${{ secrets.AWS_DEFAULT_REGION }} | |
| - name: Upload to S3 | |
| if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch' }} | |
| working-directory: ./${{ matrix.package }} | |
| run: | | |
| aws s3 cp \ | |
| ${{ matrix.package }}.zip \ | |
| s3://${{ secrets.AWS_PUBLIC_BUCKET }}/azure-functions-repo/${{ matrix.package }}.zip |