-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (60 loc) · 2.12 KB
/
Copy pathrelease.yml
File metadata and controls
68 lines (60 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Release
on:
push:
branches:
- "main"
permissions:
contents: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Clone repository
uses: actions/checkout@v7.0.0
with:
fetch-depth: "0"
token: ${{ secrets.TOKEN_GITHUB_TO_GITHUB_REPOSITORIES_RW }}
- name: Install inotify-tools
run: sudo apt-get install -y inotify-tools
- name: Use Elixir
uses: erlef/setup-beam@v1.24.0
id: beam
with:
version-file: .tool-versions
version-type: strict
- name: Install mix dependencies
run: mix deps.get
- name: Compile dependencies
run: mix deps.compile
- name: Compile
run: mix compile --warnings-as-errors --force
- name: Check formatting
run: mix format --check-formatted
- name: Check unused dependencies
run: mix deps.unlock --check-unused
- name: Lint
run: mix credo
- name: Run tests
run: mix test
- name: Get next version
id: get_next_version
uses: thenativeweb/get-next-version@2.7.2
- name: Create new version
if: ${{ steps.get_next_version.outputs.hasNextVersion == 'true' }}
run: |
sed -i 's/@version ".*"/@version "${{ steps.get_next_version.outputs.version }}"/' mix.exs
sed -i 's/{:eventsourcingdb, "~> [^"]*"}/{:eventsourcingdb, "~> ${{ steps.get_next_version.outputs.version }}"}/' README.md
git config --global user.email "hello@thenativeweb.io"
git config --global user.name "${{ github.actor }}"
git add .
git commit -m 'chore: Bump version to ${{ steps.get_next_version.outputs.version }}. [skip ci]'
git push
git tag ${{ steps.get_next_version.outputs.version }}
git push origin ${{ steps.get_next_version.outputs.version }}
- name: Publish package
if: ${{ steps.get_next_version.outputs.hasNextVersion == 'true' }}
env:
HEX_API_KEY: ${{ secrets.TOKEN_GITHUB_TO_HEXPM_RW }}
run: mix hex.publish --yes