From 4402bd5ad07a069ebf9ba3410110a39158cb076d Mon Sep 17 00:00:00 2001 From: ns212 Date: Wed, 28 Feb 2024 10:51:42 +0000 Subject: [PATCH 1/2] ci: update github actions --- .github/dependabot.yml | 7 +++++ .github/workflows/release.yml | 54 +++++++++++------------------------ .github/workflows/test.yml | 8 ++++-- 3 files changed, 29 insertions(+), 40 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..23c4cb3b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +--- +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 995b6624..875b552f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,47 +1,27 @@ -name: "Deploy" +name: "Publish snap to npm" on: - workflow_dispatch: - inputs: - environment: - description: "Environment to deploy snap" - type: environment - required: true + push: + jobs: - deploy: + publish: runs-on: ubuntu-latest - environment: ${{ inputs.environment }} timeout-minutes: 10 + defaults: + run: + working-directory: ./packages/snap steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 16 - - name: install dependencies + node-version: 20 + cache: yarn + - name: Install dependencies run: yarn install - - name: run test + - name: Test run: yarn test - name: Build - run: CI=false yarn run build - working-directory: packages/example + run: yarn build + - name: Publish to NPM + run: yarn publish env: - PROJECT_TOKEN: ${{ secrets.PROJECT_TOKEN }} - BACKEND_API_AUTH: ${{ secrets.BACKEND_API_AUTH }} - BACKEND_API_DOMAIN: ${{ secrets.BACKEND_API_DOMAIN }} - SNAP_BACKEND_API_DOMAIN: ${{ secrets.SNAP_BACKEND_API_DOMAIN }} - SNAP_BACKEND_API_AUTH: ${{ secrets.SNAP_BACKEND_API_AUTH }} - FIAT_MRCR_API_WIDGET_ID: ${{ secrets.FIAT_MRCR_API_WIDGET_ID }} - SENTRY_ORG: ${{ secrets.SENTRY_ORG }} - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_SOURCE: ${{ secrets.SENTRY_SOURCE }} - SENTRY_PROJECT: bob-snap-${{ inputs.environment }} - ENV: ${{ inputs.environment }} - - name: Publish to S3 - working-directory: packages/example - run: | - curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" - unzip -qq awscliv2.zip - sudo ./aws/install --update - aws configure set aws_access_key_id ${{ secrets.AWS_KEY_ID }} - aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws configure set default.region ${{ secrets.AWS_REGION }} - aws s3 sync --exclude "*.map" build/ s3://${{ secrets.BUCKET_NAME }}/ --delete + NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index edcd73b4..d85e3700 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,10 +6,12 @@ on: jobs: test: runs-on: ubuntu-latest - container: node:16 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: yarn - name: Install dependencies run: yarn - name: Run Test From f9707b8f4f9ed12434d26652502c6dcde8252e57 Mon Sep 17 00:00:00 2001 From: ns212 Date: Wed, 28 Feb 2024 10:52:58 +0000 Subject: [PATCH 2/2] ci: update github actions --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 875b552f..1d5b88b7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,8 @@ name: "Publish snap to npm" on: push: + tags: + - '*' jobs: publish: