From ffd9e6f4d0a3cfe66e950fc81e4513937208545c Mon Sep 17 00:00:00 2001 From: Ted Patrick Date: Thu, 14 Sep 2023 11:04:13 -0500 Subject: [PATCH] Next Build Snapshot (#1703) --- .github/workflows/next-build-snapshot.yml | 58 +++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/next-build-snapshot.yml diff --git a/.github/workflows/next-build-snapshot.yml b/.github/workflows/next-build-snapshot.yml new file mode 100644 index 00000000..32d054a2 --- /dev/null +++ b/.github/workflows/next-build-snapshot.yml @@ -0,0 +1,58 @@ +name: "Next Build Snapshot" + +on: + workflow_dispatch: + inputs: + snapshot_version: + description: "The calver version of this snapshot: 2022.09.1 or 2022.09.1.RC1" + type: string + required: true + +jobs: + next-build-snapshot: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: next + + - name: Install node + uses: actions/setup-node@v3 + with: + node-version: 18.x + + - name: Cache node modules + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - name: Install Dependencies + working-directory: ./pyscript.core + run: npm install + + - name: Build Pyscript.core + working-directory: ./pyscript.core + run: npm run build + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1.6.1 + with: + aws-region: ${{ secrets.AWS_REGION }} + role-to-assume: ${{ secrets.AWS_OIDC_RUNNER_ROLE }} + + - name: Copy to Snapshot + working-directory: ./pyscript.core/dist + run: > + aws s3 sync . s3://pyscript.net/snapshots/${{ inputs.snapshot_version }}/