From 27f4e44d5b2e08814e111ee8cac009a7b365b35b Mon Sep 17 00:00:00 2001 From: Florian Loitsch Date: Wed, 4 Sep 2024 12:31:57 +0200 Subject: [PATCH] Update the CI. (#73) --- .github/dependabot.yml | 8 ++++++ .github/workflows/ci.yml | 58 +++------------------------------------- 2 files changed, 11 insertions(+), 55 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..21529b7 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" # Necessary to update action hashs + directory: "/" + schedule: + interval: "weekly" + # Allow up to 3 opened pull requests for github-actions versions + open-pull-requests-limit: 3 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 723107c..de29d48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,8 +6,6 @@ on: types: [published] env: - BUCKET: toit-web - BUCKET_PATH: pkg.toit.io BUILD_DIR: build HAS_PROTOBUF: false RUN_TESTS: false @@ -18,12 +16,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive # We are using deprecated functionality. Downgrade Node so we still compile. - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 16 @@ -72,7 +70,7 @@ jobs: tar c -zf $VERSION.$ARTIFACT_EXTENSION -C $BUILD_DIR/ . - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: build retention-days: 2 @@ -93,53 +91,3 @@ jobs: asset_name: build.${{ env.ARTIFACT_EXTENSION }} tag: ${{ github.event.release.tag_name }} overwrite: true - - upload: - runs-on: ubuntu-latest - needs: [ ci ] - if: | - github.event_name == 'release' || - github.event_name == 'push' && github.ref_name == 'master' || - github.event_name == 'push' && startsWith(github.ref_name, 'release-v') - - steps: - - name: Download artifacts - uses: actions/download-artifact@v3 - with: - name: build - - - name: Set up env - run: | - # Just for debugging and better understanding list all files we have now. - find . - VERSION=$(cat VERSION) - ARTIFACT=$VERSION.$ARTIFACT_EXTENSION - echo BUILD_VERSION=$VERSION >> $GITHUB_ENV - echo ARTIFACT=$ARTIFACT >> $GITHUB_ENV - - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v0 - with: - credentials_json: ${{ secrets.INFRASTRUCTURE_SERVICE_ACCOUNT_JSON_KEY }} - service_account: github-action@infrastructure-220307.iam.gserviceaccount.com - - - name: Set up Cloud SDK - uses: google-github-actions/setup-gcloud@v0 - with: - project_id: infrastructure-220307 - - - name: Upload to Google Cloud - run: | - echo -n $BUILD_VERSION > LATEST.tmp - - gsutil cp $ARTIFACT gs://$BUCKET/$BUCKET_PATH/$BUILD_VERSION.$ARTIFACT_EXTENSION - gsutil cp LATEST.tmp gs://$BUCKET/$BUCKET_PATH/LATEST - - - name: Update RELEASED in Google Cloud - if: | - github.event_name == 'release' && !github.event.release.prerelease - run: | - echo -n $BUILD_VERSION > LATEST.tmp - - gsutil cp LATEST.tmp gs://$BUCKET/$BUCKET_PATH/RELEASED - gsutil cp LATEST.tmp gs://$BUCKET/$BUCKET_PATH/RELEASED.$BUILD_VERSION