diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index c4d1d0a91c38..b7d40f1392af 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -275,40 +275,7 @@ jobs: docker://ghcr.io/$DOCKER_IMAGE_ID:latest fi - publish-github: - runs-on: ubuntu-latest - needs: [deps, lint, test, test-cov, configure, build] - if: startsWith(github.ref, 'refs/tags/v') - env: - VERSION: ${{ needs.configure.outputs.version }} - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Download binaries - uses: actions/download-artifact@v2 - with: - name: binaries - path: dist - - name: Create release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - set -x - assets=() - for asset in ./dist/*; do - assets+=("-a" "$asset") - done - hub release create "${assets[@]}" -m "$VERSION" -m "$(cat ./release\ notes/${VERSION}.md)" "$VERSION" - - name: Upload packages to Bintray - run: | - # Publishing deb - curl --fail -H "X-GPG-PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}" -T "dist/k6-$VERSION-amd64.deb" \ - "https://${{ secrets.BINTRAY_USER }}:${{ secrets.BINTRAY_KEY }}@api.bintray.com/content/loadimpact/deb/k6/${VERSION#v}/k6-${VERSION}-amd64.deb;deb_distribution=stable;deb_component=main;deb_architecture=amd64;publish=1;override=1" - # Publishing rpm - curl --fail -H "X-GPG-PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}" -T "dist/k6-$VERSION-amd64.rpm" \ - "https://${{ secrets.BINTRAY_USER }}:${{ secrets.BINTRAY_KEY }}@api.bintray.com/content/loadimpact/rpm/k6/${VERSION#v}/k6-${VERSION}-amd64.rpm?publish=1&override=1" - - publish-windows: + package-windows: runs-on: windows-latest defaults: run: @@ -367,12 +334,14 @@ jobs: uses: crazy-max/ghaction-chocolatey@b6061d587628735be315d74358228b83a7dba9a7 with: args: pack --verbose --outputdirectory .\packaging .\packaging\k6.portable.nuspec - - name: Upload packages to Bintray - run: | - cd .\packaging - $env:VERSION = $env:VERSION.TrimStart("v", " ") - curl.exe --fail -H "X-GPG-PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}" -T .\k6.msi "https://${{ secrets.BINTRAY_USER }}:${{ secrets.BINTRAY_KEY }}@api.bintray.com/content/loadimpact/windows/k6/$env:VERSION/k6-v$env:VERSION-amd64.msi?publish=1&override=1" - curl.exe --fail -H "X-GPG-PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}" -T .\k6.portable.$env:VERSION.nupkg "https://${{ secrets.BINTRAY_USER }}:${{ secrets.BINTRAY_KEY }}@api.bintray.com/content/loadimpact/choco/k6.portable/$env:VERSION/k6.portable.$env:VERSION.nupkg?publish=1&override=1" + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: binaries-windows + path: | + packaging/k6.msi + packaging/k6.*.nupkg + retention-days: 7 publish-macos: runs-on: macos-latest @@ -388,3 +357,61 @@ jobs: - name: Create version bump PR run: brew bump-formula-pr k6 --url="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/archive/${VERSION}.tar.gz" \ --sha256="$(shasum -a 256 ${VERSION}.tar.gz | cut -d' ' -f1)" + + publish-github: + runs-on: ubuntu-latest + needs: [configure, deps, lint, test, test-cov, build, package-windows] + if: startsWith(github.ref, 'refs/tags/v') + env: + VERSION: ${{ needs.configure.outputs.version }} + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Download binaries + uses: actions/download-artifact@v2 + with: + name: binaries + path: dist + - name: Download Windows binaries + uses: actions/download-artifact@v2 + with: + name: binaries-windows + path: dist + - name: Create release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -x + assets=() + for asset in ./dist/*; do + assets+=("-a" "$asset") + done + hub release create "${assets[@]}" -m "$VERSION" -m "$(cat ./release\ notes/${VERSION}.md)" "$VERSION" + + publish-bintray: + runs-on: ubuntu-latest + needs: [configure, build, package-windows] + if: startsWith(github.ref, 'refs/tags/v') + env: + VERSION: ${{ needs.configure.outputs.version }} + steps: + - name: Download binaries + uses: actions/download-artifact@v2 + with: + name: binaries + path: dist + - name: Download Windows binaries + uses: actions/download-artifact@v2 + with: + name: binaries-windows + path: dist + - name: Upload packages to Bintray + run: | + curl -fsS -H "X-GPG-PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}" -T "dist/k6-$VERSION-amd64.deb" \ + "https://${{ secrets.BINTRAY_USER }}:${{ secrets.BINTRAY_KEY }}@api.bintray.com/content/loadimpact/deb/k6/${VERSION#v}/k6-${VERSION}-amd64.deb;deb_distribution=stable;deb_component=main;deb_architecture=amd64;publish=1;override=1" + curl -fsS -H "X-GPG-PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}" -T "dist/k6-$VERSION-amd64.rpm" \ + "https://${{ secrets.BINTRAY_USER }}:${{ secrets.BINTRAY_KEY }}@api.bintray.com/content/loadimpact/rpm/k6/${VERSION#v}/k6-${VERSION}-amd64.rpm?publish=1&override=1" + curl -fsS -H "X-GPG-PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}" -T "dist/k6.msi" \ + "https://${{ secrets.BINTRAY_USER }}:${{ secrets.BINTRAY_KEY }}@api.bintray.com/content/loadimpact/windows/k6/${VERSION#v}/k6-${VERSION}-amd64.msi?publish=1&override=1" + curl -fsS -H "X-GPG-PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}" -T "dist/k6.portable.${VERSION#v}.nupkg" \ + "https://${{ secrets.BINTRAY_USER }}:${{ secrets.BINTRAY_KEY }}@api.bintray.com/content/loadimpact/choco/k6.portable/${VERSION#v}/k6.portable.${VERSION}.nupkg?publish=1&override=1"