v0.5.0 #15
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to Hex.pm | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| - 'v*.*.*-rc.*' | |
| - 'v*.*.*-beta.*' | |
| - 'v*.*.*-alpha.*' | |
| env: | |
| MIX_ENV: prod | |
| ELIXIR_VERSION: "1.18" | |
| OTP_VERSION: "27" | |
| jobs: | |
| publish: | |
| name: Publish to Hex.pm | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: ${{ env.ELIXIR_VERSION }} | |
| otp-version: ${{ env.OTP_VERSION }} | |
| - name: Cache dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: ${{ runner.os }}-mix-publish-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-mix-publish- | |
| - name: Install dependencies | |
| run: | | |
| mix deps.get --only prod | |
| MIX_ENV=dev mix deps.get --only dev | |
| - name: Compile project | |
| run: | | |
| mix compile | |
| MIX_ENV=dev mix compile | |
| - name: Run tests | |
| run: mix test --exclude slow --exclude omnetpp | |
| - name: Build documentation | |
| env: | |
| MIX_ENV: dev | |
| run: mix docs | |
| - name: Publish to Hex | |
| env: | |
| HEX_API_KEY: ${{ secrets.HEX_API_KEY }} | |
| MIX_ENV: dev | |
| run: | | |
| mix hex.publish --yes --replace | |
| - name: Create GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| prerelease: ${{ contains(github.ref, '-rc.') || contains(github.ref, '-beta.') || contains(github.ref, '-alpha.') }} | |
| files: | | |
| CHANGELOG.md | |