diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 44c8fb1..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Main - -on: - push: - branches: [ main ] - -jobs: - test: - name: test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: ~/.elm - key: ${{ runner.os }}-${{ hashFiles('**/elm.json') }} - - uses: cachix/install-nix-action@v18 - with: - nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/02ac89b8e803.tar.gz - - uses: cachix/cachix-action@v12 - with: - name: elm-robots-humans - authToken: ${{secrets.CACHIX_AUTH_TOKEN}} - - name: Run tests - run: nix-shell --run "elm-coverage" - - name: Make build - run: nix-shell --run "elm make --output /dev/null" - - name: Make docs - run: nix-shell --run "elm make --docs docs.json" - - publish: - name: publish - needs: [test] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: ~/.elm - key: ${{ runner.os }}-${{ hashFiles('**/elm.json') }} - - uses: cachix/install-nix-action@v18 - with: - nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/02ac89b8e803.tar.gz - - uses: cachix/cachix-action@v12 - with: - name: elm-robots-humans - authToken: ${{secrets.CACHIX_AUTH_TOKEN}} - - name: Publish package - uses: dillonkearns/elm-publish-action@1.0.1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 8250959..8b9304f 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -3,6 +3,8 @@ name: Pull Request on: pull_request: branches: [ main ] + push: + branches: [ main ] jobs: test: @@ -23,3 +25,5 @@ jobs: authToken: ${{secrets.CACHIX_AUTH_TOKEN}} - name: Run tests run: nix-shell --run "elm-coverage" + - name: Make build + run: nix-shell --run "elm make --output /dev/null" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..299ebb7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release + +on: + release: + types: [ published ] + +jobs: + release: + name: release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/cache@v3 + with: + path: ~/.elm + key: ${{ runner.os }}-${{ hashFiles('**/elm.json') }} + - uses: cachix/install-nix-action@v18 + with: + nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/02ac89b8e803.tar.gz + - uses: cachix/cachix-action@v12 + with: + name: elm-robots-humans + authToken: ${{secrets.CACHIX_AUTH_TOKEN}} + - name: Run tests + run: nix-shell --run "elm-coverage" + - name: Make build + run: nix-shell --run "elm make --output /dev/null" + - name: Make docs + run: nix-shell --run "elm make --docs docs.json" + - name: Publish + run: nix-shell --run "elm publish"