diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 22640773..ffeb183e 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -16,7 +16,7 @@ env: jobs: compile: - name: "Compile aqua" + name: "Compile" runs-on: ubuntu-latest steps: @@ -41,7 +41,7 @@ jobs: path: cli/.js/target/scala-*/cli-fastopt.js publish-snapshot: - name: "Publish aqua snapshot" + name: "Publish snapshot" runs-on: ubuntu-latest needs: compile @@ -51,6 +51,7 @@ jobs: permissions: contents: read + pull-requests: write id-token: write steps: @@ -87,22 +88,22 @@ jobs: cache-dependency-path: "npm/package-lock.json" cache: "npm" + - run: npm i + working-directory: npm + - name: Set fluence-js version from branch if: inputs.fluence-js-version != '' working-directory: npm run: npm i @fluencelabs/fluence@${{ inputs.fluence-js-version }} - - run: npm i - working-directory: npm - - run: npm run build working-directory: npm - name: Generate package version id: version run: | - SHA=$(git rev-parse --short HEAD) - echo "::set-output name=sha::$SHA" + SHA=${{ github.event.pull_request.head.sha }} + echo "::set-output name=sha::${SHA::7}" echo "::set-output name=branch::${GITHUB_HEAD_REF//[^a-zA-Z0-9-]/-}" - name: Set package version @@ -123,18 +124,7 @@ jobs: working-directory: npm run: npm publish --tag snapshot --registry https://npm.fluence.dev - comment: - name: "Update comment" - runs-on: ubuntu-latest - - needs: - - publish-snapshot - - env: - AQUA_VERSION: ${{ needs.publish-snapshot.outputs.aqua-version }} - - steps: - - name: Find comment + - name: Find comment in PR uses: peter-evans/find-comment@v1 id: comment with: @@ -142,8 +132,10 @@ jobs: comment-author: github-actions[bot] body-includes: "## Aqua version is" - - name: Update comment + - name: Update comment in PR uses: peter-evans/create-or-update-comment@v1 + env: + AQUA_VERSION: ${{ steps.build.outputs.version }} with: comment-id: "${{ steps.comment.outputs.comment-id }}" issue-number: "${{ github.event.pull_request.number }}" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c4f4882c..bb33bece 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,6 +30,7 @@ jobs: run: sbt test snapshot: + name: "aqua" uses: ./.github/workflows/snapshot.yml aqua-playground: