diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8c2d770 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: release + +on: + push: + tags: ["v*"] + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - uses: erlef/setup-beam@v1 + with: + otp-version: "25.0" + gleam-version: "0.25.3" + + - run: cargo install tomlq + + - run: | + if [ "v$(tomlq version -f gleam.toml)" == "${{ github.ref_name }}" ]; then + exit 0 + fi + echo "tag does not match version in gleam.toml, refusing to publish" + exit 1 + - run: gleam format --check + + - run: gleam test + + - run: gleam publish -y + env: + HEXPM_USER: ${{ secrets.HEX_USERNAME }} + HEXPM_PASS: ${{ secrets.HEX_PASSWORD }} + + - uses: softprops/action-gh-release@v1 \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..67e89ac --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,27 @@ +name: main + +on: + push: + branches: ["main"] + pull_request: + branches: ["**"] + +concurrency: + group: main-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - uses: erlef/setup-beam@v1 + with: + otp-version: "25.0" + gleam-version: "0.25.3" + + - run: gleam format --check + + - run: gleam test \ No newline at end of file