version 5.7.22 #128
Workflow file for this run
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: | |
tags: | |
- "*" | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
env: | |
OPT_VERSION: "24" | |
ELIXIR_VERSION: "1.15" | |
MIX_ENV: prod | |
steps: | |
- name: Get the version | |
id: get_version | |
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: "20" | |
- name: install elixir | |
uses: erlef/setup-elixir@v1 | |
with: | |
otp-version: ${{ env.OPT_VERSION }} | |
elixir-version: ${{ env.ELIXIR_VERSION }} | |
- name: install Dependencies | |
run: | | |
mix local.rebar --force | |
mix local.hex --force | |
sudo apt-get update | |
sudo apt-get install -y postgresql-client | |
sudo apt-get install -y nodejs | |
- name: install yarn | |
uses: borales/[email protected] | |
- name: Get deps cache | |
uses: actions/cache@v2 | |
with: | |
path: deps/ | |
key: deps-${{ runner.os }}-${{ env.OPT_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('**/mix.lock') }} | |
- name: Get build cache | |
uses: actions/cache@v2 | |
with: | |
path: _build/prod/ | |
key: build-${{ runner.os }}-${{ env.OPT_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('**/mix.lock') }} | |
- name: install elixir deps | |
run: | | |
mix deps.get --only prod | |
- name: create assets | |
run: | | |
mkdir -p priv/static | |
cd assets | |
yarn install | |
yarn run deploy | |
cd .. | |
- name: compile | |
run: | | |
mix compile | |
mix phx.digest | |
- name: create release | |
run: | | |
mix release --path cforum-${{ steps.get_version.outputs.VERSION }} | |
tar -czf cforum-${{ steps.get_version.outputs.VERSION }}.tgz cforum-${{ steps.get_version.outputs.VERSION }} | |
- name: create github release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.get_version.outputs.VERSION }} | |
release_name: Release ${{ steps.get_version.outputs.VERSION }} | |
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: ./cforum-${{ steps.get_version.outputs.VERSION }}.tgz | |
asset_name: cforum-${{ steps.get_version.outputs.VERSION }}.tgz | |
asset_content_type: application/gzip |