-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (85 loc) · 2.69 KB
/
part_publish.yml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
on:
workflow_call:
inputs:
releaseName:
required: false
type: string
secrets:
HEX_API_KEY:
required: false
name: "Publish"
jobs:
hex_publish:
name: mix hex.publish
runs-on: ubuntu-latest
if: "${{ inputs.releaseName }}"
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
id: setupBEAM
with:
version-file: .tool-versions
version-type: strict
- uses: actions/cache@v4
with:
path: _build
key: mix_hex_publish-build-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-${{ hashFiles('mix.exs') }}
restore-keys: |
mix_hex_publish-build-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-
- uses: actions/cache@v4
with:
path: deps
key: mix_hex_publish-deps-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-${{ hashFiles('mix.exs') }}
restore-keys: |
mix_hex_publish-deps-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-
- run: mix deps.get
- run: mix hex.publish --yes
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
hex_build:
name: mix hex.build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
id: setupBEAM
with:
version-file: .tool-versions
version-type: strict
- uses: actions/cache@v4
with:
path: _build
key: mix_hex_build-build-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-${{ hashFiles('mix.exs') }}
restore-keys: |
mix_hex_build-build-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-
- uses: actions/cache@v4
with:
path: deps
key: mix_hex_build-deps-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-${{ hashFiles('mix.exs') }}
restore-keys: |
mix_hex_build-deps-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-
- run: mix deps.get
- run: mix hex.build --output package.tar
- uses: actions/upload-artifact@v4
with:
name: package
path: package.tar
upload:
name: "Upload"
runs-on: ubuntu-latest
if: ${{ inputs.releaseName }}
needs: ["hex_build"]
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: package
path: .
- name: Upload
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
gh release upload --clobber "${{ inputs.releaseName }}" \
package.tar