Skip to content

Commit

Permalink
ci: handle hex publishing in semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerlox committed Nov 22, 2023
1 parent 4b80d5b commit aeeba12
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 19 deletions.
32 changes: 14 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,6 @@ jobs:
with:
persist-credentials: false

- name: Use Node.js LTS
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
with:
node-version-file: ".tool-versions"

- name: Install packages
run: npm ci

- name: Audit npm signatures
run: npm audit signatures

- name: Run Semantic Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}

- name: Set up Elixir
uses: erlef/setup-beam@61e01a43a562a89bfc54c7f9a378ff67b03e4a21 # v1.16.0
with:
Expand All @@ -66,7 +50,19 @@ jobs:
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-${{ env.cache-name }}-

- name: Publish to Hex
run: mix hex.publish --yes
- name: Use Node.js LTS
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
with:
node-version-file: ".tool-versions"

- name: Install packages
run: npm ci

- name: Audit npm signatures
run: npm audit signatures

- name: Run Semantic Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
8 changes: 7 additions & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
"message": "chore(release): v${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
"@semantic-release/github"
"@semantic-release/github",
[
"@semantic-release/exec",
{
"publishCmd": "mix hex.publish --yes"
}
]
]
}
21 changes: 21 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"devDependencies": {
"@insurgent/conventional-changelog-preset": "^9.0.1",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"semantic-release": "^22.0.8",
"semantic-release-hex": "^1.1.0"
Expand Down

0 comments on commit aeeba12

Please sign in to comment.