diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..faa449e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Release gh-gk Extension + +on: + push: + tags: + - 'v*' + +jobs: + create-release: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Download Binaries + uses: actions/download-artifact@v2 + with: + name: gh-gk-binaries + path: downloaded_binaries + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + + - name: Upload Release Assets + run: | + for binary in downloaded_binaries/*; do + echo "Uploading ${binary}" + curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Content-Type: $(file -b --mime-type ${binary})" \ + --data-binary @${binary} \ + "${{ steps.create_release.outputs.upload_url }}?name=$(basename ${binary})" + done + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}