From 704e21b1443f9e1b52be3f107c7af21fab30d2ef Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Thu, 19 Nov 2020 12:14:23 -0700 Subject: [PATCH] create release and upload escript for new tags --- .github/workflows/publish.yml | 45 ++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1b52f622..5c8397c2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,34 +1,47 @@ name: Publish on: - release: - types: [published, created, edited] + push: + tags: + - '*' jobs: build: - name: Publish escript to release + name: Create release and publish escript for every new tag runs-on: ubuntu-latest - container: - image: erlang:19 - steps: - uses: actions/checkout@v2 + + - uses: gleam-lang/setup-erlang@v1.0.0 + with: + otp-version: 19.3.6.13 - name: Compile run: ./bootstrap - name: CT tests run: ./rebar3 ct - # - name: Upload Release Asset - # id: upload-release-asset - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ github.event.release.upload_url }} - # asset_path: ./rebar3 - # asset_name: rebar3 - # asset_content_type: application/zip + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + draft: false + prerelease: false + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./rebar3 + asset_name: rebar3 + asset_content_type: application/octet-stream - name: Configure AWS credentials if: "!github.event.release.prerelease"