Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow publishing to Hex #43

Merged
merged 10 commits into from
May 3, 2024
Merged

Allow publishing to Hex #43

merged 10 commits into from
May 3, 2024

Conversation

estreeper
Copy link
Collaborator

@estreeper estreeper commented May 3, 2024

This should deploy a new version to Hex when we create a release via GitHub, and also introduces testing back to Elixir version 1.12/OTP24.

Also includes a script to run the CI checks locally, and instructions on how to make it run automatically pre-push.

Minor documentation updates to specify we want PRs linked to an Issue.

@estreeper estreeper force-pushed the 34-hex-publish branch 2 times, most recently from 425a10e to 91878ef Compare May 3, 2024 20:04
Comment on lines -45 to -48
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
key: ${{ runner.os }}-mix-${{ env.cache-name }}-elixir-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
${{ runner.os }}-mix-
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to make these changes because otherwise I believe it was trying to use the same cached version for both combos (1.12/OTP24, 1.16/OTP26) and throwing an error about a BEAM version mismatch

@@ -93,7 +93,7 @@ defmodule ProdopsEx.ArtifactTest do
describe "stream_refine_artifact/2" do
test "streams refinement of an artifact by submitting a request with the required parameters" do
config = [api_url: "https://api.example.com", api_key: "secret_key"]
params = %{artifact_id: 1, artifact_slug: "story"}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a driveby fix: this test had broken during a merge

@@ -54,6 +57,7 @@ jobs:
run: mix compile --warnings-as-errors

- name: Check formatting
if: matrix.elixir == '1.16' && matrix.otp == '26'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old formatter has different opinions, so just used the newer one

@@ -67,6 +71,7 @@ jobs:
plt-cache-

- name: Check function specs with Dialyzer
if: matrix.elixir == '1.16' && matrix.otp == '26'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't causing a problem but also figured this could be skipped since the new dialyzer is probably better

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah nobody wants to wait for dialyzer to run twice

Copy link
Contributor

@grossvogel grossvogel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just use the latest supported Elixir version for the publish workflow, otherwise everything looks good

run: mix test

- name: Publish to Hex
run: mix hex.publish --yes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me like this will cause mix hex.publish to happen twice, once for each entry in the matrix. IMO we can probably just remove 1.12 from the matrix since every commit should have passed the other workflow before we tag it as a release

.github/workflows/publish-hex.yml Outdated Show resolved Hide resolved
estreeper and others added 2 commits May 3, 2024 15:40
Co-authored-by: Jason Pollentier <802805+grossvogel@users.noreply.github.com>
This would have also caused the pubish command to be run twice
@estreeper estreeper merged commit d5137c7 into main May 3, 2024
2 checks passed
@estreeper estreeper deleted the 34-hex-publish branch May 3, 2024 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants