Skip to content

Commit

Permalink
ci: Publish releases
Browse files Browse the repository at this point in the history
  • Loading branch information
taorepoara committed Aug 28, 2023
1 parent e5c2fb0 commit b934e18
Showing 1 changed file with 39 additions and 12 deletions.
51 changes: 39 additions & 12 deletions .github/workflows/semantic_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,50 @@ on:
push:
branches:
- main
- rc
- beta
- alpha
- "*.x"

jobs:
get-next-version:
uses: lenra-io/github-actions/.github/workflows/get-version.yml@main

release:
name: Release
needs: [get-next-version]
if: ${{ needs.get-next-version.outputs.will-release == 'true' }}
uses: lenra-io/github-actions/.github/workflows/release.yml@main
publish:
name: publish
needs: [get-next-version]
if: ${{ needs.get-next-version.outputs.will-release == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 10
env:
VERSION: ${{ needs.get-next-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
- name: Checkout Code
uses: actions/checkout@v3
- name: Set version
shell: bash
run: 'sed -i -r "s/version: \"[0-9]+(\.[0-9]+){2}\"/version: \"${{ env.VERSION }}\"/g" mix.exs'
- name: Set up Elixir
uses: erlef/setup-elixir@b980a5ac9b7316a23ebc16de2bb69b7c3ad731b5
with:
node-version: "14"
- name: Setup node deps
run: npm i conventional-changelog-conventionalcommits@4 -D
- name: Release
elixir-version: "1.12" # Define the elixir version [required]
otp-version: "24" # Define the OTP version [required]
- name: Restore dependencies cache
uses: actions/cache@v2
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Get dependencies
shell: bash
run: mix deps.get
- name: Publish package to hex.pm
shell: bash
run: mix hex.publish --yes
env:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_GITHUB_TOKEN }}
run: npx semantic-release@18
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}

0 comments on commit b934e18

Please sign in to comment.