add action #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
| name: export layer | |
| on: | |
| pull_request: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| # export-layer: | |
| # uses: oomol/ovmlayer-rootfs/.github/workflows/export-package-layer.yml@main | |
| # secrets: | |
| # token: ${{ secrets.GITHUB_TOKEN }} | |
| post-layer: | |
| runs-on: ubuntu-latest | |
| # needs: export-layer | |
| steps: | |
| - name: Install OIDC Client from Core Package | |
| run: npm install @actions/[email protected] @actions/http-client | |
| shell: bash | |
| - name: Get Id Token | |
| uses: actions/github-script@v7 | |
| id: id_token | |
| with: | |
| script: | | |
| const coredemo = require('@actions/core') | |
| let id_token = await coredemo.getIDToken() | |
| coredemo.setOutput('id_token', id_token) | |
| - name: put | |
| run: | | |
| echo "Layer exported successfully." | |
| curl -f -X PUT -H "Content-Type: application/json" -H "Authorization: github-action-${{ steps.id_token.outputs.id_token }}" -d '{"amd64": "https://static.oomol.com/layers/amd64-layer.zip", "arm64": "https://static.oomol.com/layers/arm64-layer.zip"}' https://registry.oomol.dev/-/oomol/packages/layer-example/0.0.1/file-paths | |
| - name: get | |
| run: | | |
| curl -f -H "Authorization: github-action-${{ steps.id_token.outputs.id_token }}" -H "Accept: application/json" https://registry.oomol.dev/-/oomol/packages/layer-example/0.0.1/file-paths |