Bump github.com/pion/dtls/v3 from 3.0.11 to 3.1.4 (#272) #216
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: Deploy Module and App | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - 'README.md' | |
| - 'DEVELOPER_GUIDE.md' | |
| - 'docs/**' | |
| - '**/*.md' | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: Version tag (e.g. v0.0.21) | |
| required: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| compute-version: | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| version: ${{ steps.resolve.outputs.version }} | |
| steps: | |
| # actions/checkout@v6.0.2 | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| - name: Bump rc tag | |
| id: bump | |
| if: github.event_name == 'push' | |
| # mathieudutour/github-tag-action@v6.2 | |
| uses: mathieudutour/github-tag-action@a22cf08638b34d5badda920f9daf6e72c477b07b | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| # Release tags come from the release event; main pushes only produce rc tags. | |
| release_branches: __none__ | |
| pre_release_branches: main | |
| append_to_pre_release_tag: rc | |
| default_bump: patch | |
| - name: Resolve version | |
| id: resolve | |
| run: | | |
| if [ "${{ github.event_name }}" = "push" ]; then | |
| VERSION="${{ steps.bump.outputs.new_tag }}" | |
| else | |
| VERSION="${{ inputs.version || github.ref_name }}" | |
| fi | |
| echo "Resolved version: $VERSION" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| publish-module: | |
| needs: [compute-version] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| # actions/checkout@v6.0.2 | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - name: Build and upload to Viam Registry | |
| # viamrobotics/build-action@v1.7.2 | |
| uses: viamrobotics/build-action@68c0a3cef8247f2324a6de7107b09fa9e9ef8b49 | |
| with: | |
| version: ${{ needs.compute-version.outputs.version }} | |
| ref: ${{ github.sha }} | |
| key-id: ${{ secrets.viam_key_id }} | |
| key-value: ${{ secrets.viam_key_secret }} | |
| token: ${{ github.token }} | |
| publish-app: | |
| needs: [compute-version] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| # actions/checkout@v6.0.2 | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| # actions/setup-node@v6.3.0 | |
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: web-app/package-lock.json | |
| # actions/setup-go@v6.3.0 | |
| - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 | |
| with: | |
| go-version-file: go.mod | |
| - name: Build web app module | |
| run: make web-app-module | |
| - name: Upload to Viam Registry | |
| # viamrobotics/upload-module@v1.2 | |
| uses: viamrobotics/upload-module@31b3909ba4d40f22a58c8479f3b4302538a5099b | |
| with: | |
| meta-path: web-app/meta.json | |
| module-path: web-app/module.tar.gz | |
| platform: any | |
| version: ${{ needs.compute-version.outputs.version }} | |
| key-id: ${{ secrets.viam_key_id }} | |
| key-value: ${{ secrets.viam_key_secret }} | |
| do-update: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && !github.event.release.prerelease) }} | |
| do-upload: true | |
| send-slack-msg: | |
| name: Send Slack Message | |
| needs: [compute-version, publish-module, publish-app] | |
| runs-on: ubuntu-24.04 | |
| if: always() | |
| steps: | |
| - name: Generate metadata | |
| id: meta | |
| run: | | |
| set -euo pipefail | |
| VERSION="${{ needs.compute-version.outputs.version }}" | |
| if [ "${{ github.event_name }}" = "push" ]; then | |
| KIND="rc build" | |
| LINK_URL="${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}" | |
| LINK_LABEL="commit ${GITHUB_SHA:0:7}" | |
| else | |
| KIND="release" | |
| LINK_URL="${{ github.server_url }}/${{ github.repository }}/releases/tag/${VERSION}" | |
| LINK_LABEL="Release ${VERSION}" | |
| fi | |
| if [ "${{ needs.publish-module.result }}" = "success" ] && [ "${{ needs.publish-app.result }}" = "success" ]; then | |
| RESULT="success" | |
| else | |
| RESULT="failure" | |
| fi | |
| { | |
| echo "version=$VERSION" | |
| echo "kind=$KIND" | |
| echo "link_url=$LINK_URL" | |
| echo "link_label=$LINK_LABEL" | |
| echo "result=$RESULT" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Send slack message | |
| # slackapi/slack-github-action@v2.1.1 | |
| uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a | |
| with: | |
| method: chat.postMessage | |
| token: ${{ secrets.SLACK_BOT_TOKEN }} | |
| payload: | | |
| { | |
| "channel": "${{ secrets.SLACK_CHANNEL_ID }}", | |
| "text": "Deploy ${{ steps.meta.outputs.version }} (${{ steps.meta.outputs.kind }}) ${{ steps.meta.outputs.result == 'success' && '*succeeded* :white_check_mark:' || '*failed* :x:'}}", | |
| "blocks": [ | |
| { | |
| "type": "section", | |
| "text": { | |
| "type": "mrkdwn", | |
| "text": "${{ steps.meta.outputs.result == 'success' && format('Deploy *{0}* ({1}) *succeeded* :white_check_mark:\n\t<{2}|{3}>', steps.meta.outputs.version, steps.meta.outputs.kind, steps.meta.outputs.link_url, steps.meta.outputs.link_label) || format('Deploy *{0}* ({1}) *failed* :x:\n\t<{2}|{3}>', steps.meta.outputs.version, steps.meta.outputs.kind, steps.meta.outputs.link_url, steps.meta.outputs.link_label) }}\n\tModule: ${{ needs.publish-module.result }}\n\tWeb app: ${{ needs.publish-app.result }}\n\t<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Workflow run>" | |
| } | |
| } | |
| ] | |
| } |