From a53836cc671a6a078d20e4e9ce0c0b7eeee36e5e Mon Sep 17 00:00:00 2001 From: Christophe Leclef Date: Thu, 9 Jun 2022 12:15:54 +0200 Subject: [PATCH] publish on hex.pm on release creation --- .github/workflows/publish_on_release.yml | 33 ++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/publish_on_release.yml diff --git a/.github/workflows/publish_on_release.yml b/.github/workflows/publish_on_release.yml new file mode 100644 index 0000000..c7c8b68 --- /dev/null +++ b/.github/workflows/publish_on_release.yml @@ -0,0 +1,33 @@ +name: Publish release to the Hex.pm + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + strategy: + matrix: + otp: ['21.3.8.21'] + elixir: ['1.8.2', '1.9.4', '1.10.4'] + steps: + - uses: actions/checkout@v2 + - uses: erlef/setup-elixir@v1 + with: + otp-version: ${{matrix.otp}} + elixir-version: ${{matrix.elixir}} + - name: Restore dependencies cache + uses: actions/cache@v2 + with: + path: deps + key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} + restore-keys: ${{ runner.os }}-mix- + - name: Install dependencies + run: mix deps.get + - name: Run tests + run: mix test + - name: Publish package + run: mix hex.publish --yes + env: + HEX_API_KEY: ${{ secrets.HEX_API_KEY }}