From a7c3f0f67905129f2592b34f7ecbb571c42ae6a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Jod=C5=82os=CC=81?= Date: Thu, 23 May 2024 09:31:08 +0200 Subject: [PATCH] Add release.yml --- .github/workflows/elixir.yml | 61 ++++++++++++++++------------------- .github/workflows/release.yml | 19 +++++++++++ 2 files changed, 47 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index d824990..05ba6bf 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -1,15 +1,10 @@ - # This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - name: Elixir CI on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] permissions: contents: read @@ -20,29 +15,29 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Set up Elixir - uses: erlef/setup-beam@61e01a43a562a89bfc54c7f9a378ff67b03e4a21 # v1.16.0 - with: - elixir-version: '1.16.2' # [Required] Define the Elixir version - otp-version: '26.0' # [Required] Define the Erlang/OTP version - - name: brndnmtthws/rust-action-rustup - uses: brndnmtthws/rust-action-rustup@v1.0.0 - - name: Restore dependencies cache - uses: actions/cache@v3 - with: - path: deps - key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} - restore-keys: ${{ runner.os }}-mix- - - name: Checkout LFS - uses: nschloe/action-cached-lfs-checkout@v1.1.2 - - name: Install dependencies - run: mix deps.get && mix deps.compile - - name: Checks if compiles without warning - run: mix compile --warnings-as-errors - - name: Run tests - run: mix test - - name: Run Credo - run: mix credo - - name: Test formatting - run: mix format --check-formatted + - uses: actions/checkout@v4 + - name: Set up Elixir + uses: erlef/setup-beam@61e01a43a562a89bfc54c7f9a378ff67b03e4a21 # v1.16.0 + with: + elixir-version: "1.16.2" # [Required] Define the Elixir version + otp-version: "26.0" # [Required] Define the Erlang/OTP version + - name: brndnmtthws/rust-action-rustup + uses: brndnmtthws/rust-action-rustup@v1.0.0 + - name: Restore dependencies cache + uses: actions/cache@v3 + with: + path: deps + key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} + restore-keys: ${{ runner.os }}-mix- + - name: Checkout LFS + uses: nschloe/action-cached-lfs-checkout@v1.1.2 + - name: Install dependencies + run: mix deps.get && mix deps.compile + - name: Checks if compiles without warning + run: mix compile --warnings-as-errors + - name: Run tests + run: mix test + - name: Run Credo + run: mix credo + - name: Test formatting + run: mix format --check-formatted diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a254572 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,19 @@ +name: Release package + +on: + push: + tags: + - "v*" + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "latest" + prerelease: true + title: "Release ${{ github.ref }}" + files: models/*