From ac0268361ad365e79c7b4eb527c6c87b2ab5ec33 Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Fri, 21 Aug 2020 14:43:07 +0300 Subject: [PATCH] updated build-go-packages and create-pr --- .github/workflows/build-go-packages.yml | 18 ++++++------------ .github/workflows/create-pr.yml | 17 ++++++----------- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build-go-packages.yml b/.github/workflows/build-go-packages.yml index 3ccd756..ae4237f 100644 --- a/.github/workflows/build-go-packages.yml +++ b/.github/workflows/build-go-packages.yml @@ -1,6 +1,5 @@ name: Generate Go package on: -# TODO: currently workflow dispatch endpoint does not work. I will investigate workflow_dispatch: inputs: VERSION: @@ -20,6 +19,8 @@ jobs: build_go: name: Build Go ${{ github.event.inputs.VERSION }} [${{ matrix.platform }}] runs-on: ubuntu-latest + env: + ARTIFACT_NAME: go-${{ github.event.inputs.VERSION }}-${{ matrix.platform }}-x64 strategy: fail-fast: false matrix: @@ -29,17 +30,9 @@ jobs: with: submodules: true - - name: Create artifact directories - run: | - binariesDirectory=$RUNNER_WORKSPACE/binaries - echo ::set-env name=BINARIES_DIRECTORY::$binariesDirectory - mkdir $binariesDirectory - artifactDirectory=$RUNNER_WORKSPACE/artifact - echo ::set-env name=ARTIFACT_DIRECTORY::$artifactDirectory - mkdir $artifactDirectory - name: Build Go ${{ env.VERSION }} run: | - ./builders/build-go.ps1 -Version $env:VERSION ` + ./builders/build-node.ps1 -Version $env:VERSION ` -Platform ${{ matrix.platform }} ` -Architecture $env:ARCHITECTURE shell: pwsh @@ -47,8 +40,9 @@ jobs: - name: Publish artifact uses: actions/upload-artifact@v2 with: - name: go-${{ env.VERSION }}-${{ matrix.platform }} - path: /home/runner/work/go-versions/artifact + name: ${{ env.ARTIFACT_NAME }} + path: ${{ runner.temp }}/artifact + test_go: name: Test Go ${{ github.event.inputs.VERSION }} [${{ matrix.platform }}] needs: build_go diff --git a/.github/workflows/create-pr.yml b/.github/workflows/create-pr.yml index 64922ad..0d03c0f 100644 --- a/.github/workflows/create-pr.yml +++ b/.github/workflows/create-pr.yml @@ -1,14 +1,11 @@ name: Create Pull Request -on: -# TODO: currently workflow dispatch endpoint does not work. I will investigate +on: repository_dispatch: types: [create-pr] workflow_dispatch: jobs: - build: + create_pr: name: Create Pull Request - env: - REPOSITORY_NAME: 'go-versions' runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -18,18 +15,16 @@ jobs: - name: Create versions-manifest.json shell: pwsh run: | - ./helpers/packages-generation/manifest-generator.ps1 -GitHubRepositoryOwner "${{github.repository_owner}}" ` - -GitHubRepositoryName "$env:REPOSITORY_NAME"` - -GitHubAccessToken "${{secrets.GITHUB_TOKEN}}"` - -OutputFile "./versions-manifest.json"` + ./helpers/packages-generation/manifest-generator.ps1 -RepositoryFullName "$env:GITHUB_REPOSITORY" ` + -GitHubAccessToken "${{secrets.GITHUB_TOKEN}}" ` + -OutputFile "./versions-manifest.json" ` -ConfigurationFile "./config/go-manifest-config.json" - name: Create GitHub PR shell: pwsh run: | $formattedDate = Get-Date -Format "MM/dd/yyyy" ./helpers/github/create-pull-request.ps1 ` - -RepositoryOwner "${{github.repository_owner}}" ` - -RepositoryName "$env:REPOSITORY_NAME" ` + -RepositoryFullName "$env:GITHUB_REPOSITORY" ` -AccessToken "${{secrets.GITHUB_TOKEN}}" ` -BranchName "update-versions-manifest-file" ` -CommitMessage "Update versions-manifest" `