From 5b5bb8862b7527aeeb743a6e02eef28fb8a2cab1 Mon Sep 17 00:00:00 2001 From: Timur Zununbekov Date: Wed, 21 Feb 2024 12:37:46 +0600 Subject: [PATCH] Restore workflows order --- .github/workflows/build-packages.yml | 36 ++++++++++++--------- .github/workflows/release.yml | 43 +++++++++++++++++-------- .github/workflows/tests-and-linters.yml | 3 +- 3 files changed, 51 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build-packages.yml b/.github/workflows/build-packages.yml index 716459b698..3c1818a247 100644 --- a/.github/workflows/build-packages.yml +++ b/.github/workflows/build-packages.yml @@ -3,7 +3,7 @@ name: Build packages on: workflow_call: push: - branches: [master, ci-migration] + branches: [master] tags: env: @@ -71,17 +71,17 @@ jobs: max-parallel: 4 matrix: platform: - # - PackageLinuxRaspberryImage + - PackageLinuxRaspberryImage - PackageLinuxAmd64 - # - PackageLinuxArm - # - PackageLinuxDebianAmd64 - # - PackageLinuxDebianArm64 - # - PackageLinuxDebianArm - # - PackageMacOSAmd64 - # - PackageMacOSArm64 - # - PackageWindowsAmd64 - # - PackageAndroid - # - PackageAndroidProvider + - PackageLinuxArm + - PackageLinuxDebianAmd64 + - PackageLinuxDebianArm64 + - PackageLinuxDebianArm + - PackageMacOSAmd64 + - PackageMacOSArm64 + - PackageWindowsAmd64 + - PackageAndroid + - PackageAndroidProvider steps: - uses: actions/checkout@v4 @@ -95,9 +95,8 @@ jobs: - name: Create bucket if: | - contains(github.ref, 'refs/tags') || github.ref == 'refs/heads/master' || - github.ref == 'refs/heads/ci-migration' + github.ref_type == 'tag' env: AWS_EC2_METADATA_DISABLED: true run: | @@ -137,9 +136,14 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Build docker - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} run: | source env.sh go run mage.go -v PackageDockerSwaggerRedoc + + release: + needs: [build-packages, build-swagger] + uses: ./.github/workflows/release.yml + secrets: inherit + if: | + github.ref == 'refs/heads/master' || + github.ref_type == 'tag' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 09b2396c97..0c1cf39ce6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,19 +1,26 @@ name: Release on: workflow_call: - # push: - # tags: + +env: + GITHUB_OWNER: mysteriumnetwork + GITHUB_REPO: node + GITHUB_SNAPSHOT_REPO: node-builds + GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} jobs: release-snapshot: runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' strategy: max-parallel: 3 matrix: platform: - ReleaseGithubSnapshot - # master only + # Nightly build # - ReleaseGithubNightly - ReleaseDockerSnapshot - ReleaseDebianPPASnapshot @@ -32,7 +39,7 @@ jobs: - name: Release snapshot run: | source env.sh - go run mage.go -v ${{ matrix.platform }} + sudo -E go run mage.go -v ${{ matrix.platform }} - name: Release Go report if: github.ref == 'refs/heads/master' @@ -40,6 +47,7 @@ jobs: release-tag: runs-on: ubuntu-latest + if: github.ref_type == 'tag' strategy: max-parallel: 4 @@ -65,10 +73,13 @@ jobs: - name: Release tag run: | source build/env.sh - go run mage.go -v ${{ matrix.platform }} + sudo -E go run mage.go -v ${{ matrix.platform }} post-release: runs-on: ubuntu-latest + needs: [release-snapshot, release-tag] + if: always() && contains(join(needs.*.result, ','), 'success') + steps: - uses: actions/checkout@v4 - name: Setup Go @@ -81,13 +92,19 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Remove bucket - run: go run mage.go -v RemoveBucket - - name: Notify UptimeRobot - if: github.ref == 'refs/heads/master' + env: + AWS_EC2_METADATA_DISABLED: true run: | - if [ "$NIGHTLY_BUILD" = "1" -o "$NIGHTLY_BUILD" = "T" -o "$NIGHTLY_BUILD" = "true" -o "$NIGHTLY_BUILD" = "True" -o "$NIGHTLY_BUILD" = "TRUE" ]; then - curl -so /dev/null -I "$NIGHTLY_UPTIMEROBOT" - fi - - name: PR Avado - run: go run mage.go -v CreateAvadoPR + source env.sh + go run mage.go -v RemoveBucket + # - name: Notify UptimeRobot + # if: github.ref == 'refs/heads/master' + # run: | + # if [ "$NIGHTLY_BUILD" = "1" -o "$NIGHTLY_BUILD" = "T" -o "$NIGHTLY_BUILD" = "true" -o "$NIGHTLY_BUILD" = "True" -o "$NIGHTLY_BUILD" = "TRUE" ]; then + # curl -so /dev/null -I "$NIGHTLY_UPTIMEROBOT" + # fi + # - name: PR Avado + # run: | + # source env.sh + # go run mage.go -v CreateAvadoPR diff --git a/.github/workflows/tests-and-linters.yml b/.github/workflows/tests-and-linters.yml index 1847bf1c01..dc006ea6fe 100644 --- a/.github/workflows/tests-and-linters.yml +++ b/.github/workflows/tests-and-linters.yml @@ -1,7 +1,6 @@ name: Tests on: - workflow_call: - # pull_request: + pull_request: env: GOFLAGS: "-count=1"