Fix team publish grading (#1195) #263
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build release | |
on: | |
push: | |
branches: | |
- stable | |
- master | |
- deploy | |
- deploy-stg | |
paths: | |
- "config/**" | |
- "lib/**" | |
- "priv/**" | |
- "rel/**" | |
- "test/**" | |
- "**/*.ex" | |
- "**/*.exs" | |
- "mix.lock" | |
- ".github/workflows/cd.yml" | |
- "!config/*.example" | |
jobs: | |
ci: | |
name: Build release | |
runs-on: ubuntu-20.04 | |
env: | |
MIX_ENV: prod | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ELIXIR_VERSION: 1.13.4 | |
OTP_VERSION: 25.3.2 | |
steps: | |
- uses: rlespinasse/[email protected] | |
- uses: actions/checkout@v4 | |
- name: Cache deps | |
uses: actions/cache@v4 | |
with: | |
path: deps | |
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
restore-keys: | | |
${{ runner.os }}-mix- | |
- name: Cache _build | |
uses: actions/cache@v4 | |
with: | |
path: | | |
_build | |
!_build/prod/cadet-0.0.1.tar.gz | |
key: cd-${{ env.GITHUB_REF_SLUG }}-${{ runner.os }}-erlang-${{ env.OTP_VERSION }}-elixir-${{ env.ELIXIR_VERSION }}-${{ github.sha }} | |
restore-keys: | | |
cd-${{ env.GITHUB_REF_SLUG }}-${{ runner.os }}-erlang-${{ env.OTP_VERSION }}-elixir-${{ env.ELIXIR_VERSION }}- | |
- name: Setup Elixir | |
uses: erlef/setup-elixir@v1 | |
with: | |
elixir-version: ${{ env.ELIXIR_VERSION }} | |
otp-version: ${{ env.OTP_VERSION }} | |
- name: mix deps.get | |
run: | | |
mix deps.get | |
- name: mix release | |
run: mix release --overwrite | |
- name: Create release | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
automatic_release_tag: latest-${{ env.GITHUB_REF_SLUG }} | |
prerelease: ${{ env.GITHUB_REF_SLUG == 'master' }} | |
title: Latest commit on ${{ env.GITHUB_REF_SLUG }} | |
files: _build/prod/cadet-0.0.1.tar.gz |