Add workflows

This commit is contained in:
NicklasXYZ 2023-01-25 23:46:38 +01:00
parent 54ad6b092e
commit f2200971c9
2 changed files with 63 additions and 0 deletions

36
.github/workflows/release.yml vendored Normal file
View file

@ -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

27
.github/workflows/test.yml vendored Normal file
View file

@ -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