From 31f04aafdcf496b3476257ffb3a8d9cb043d6202 Mon Sep 17 00:00:00 2001 From: ns212 <73105077+ns212@users.noreply.github.com> Date: Wed, 28 Feb 2024 11:10:25 +0000 Subject: [PATCH] ci: update github actions (#13) * ci: update github actions * ci: update github actions --- .github/dependabot.yml | 7 +++++ .github/workflows/release.yml | 56 ++++++++++++----------------------- .github/workflows/test.yml | 8 +++-- 3 files changed, 31 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..1d5b88b7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,47 +1,29 @@ -name: "Deploy" +name: "Publish snap to npm" on: - workflow_dispatch: - inputs: - environment: - description: "Environment to deploy snap" - type: environment - required: true + push: + tags: + - '*' + 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