Skip to content

Commit

Permalink
Update things for 2023 (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
tfausak authored Feb 12, 2023
1 parent 32d50fc commit 48138d7
Show file tree
Hide file tree
Showing 21 changed files with 474 additions and 359 deletions.
6 changes: 6 additions & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dockerComposeFile": "compose.yaml",
"initializeCommand": "docker volume create cabal-store",
"service": "devcontainer",
"workspaceFolder": "/workspaces/github-release"
}
2 changes: 0 additions & 2 deletions .devcontainer/Dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions .devcontainer/devcontainer.json

This file was deleted.

12 changes: 12 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"updates": [
{
"directory": "/",
"package-ecosystem": "github-actions",
"schedule": {
"interval": "daily"
}
}
],
"version": 2
}
10 changes: 0 additions & 10 deletions .github/workflows/brittany.yaml

This file was deleted.

116 changes: 0 additions & 116 deletions .github/workflows/ci.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions .github/workflows/hlint.yaml

This file was deleted.

220 changes: 220 additions & 0 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
{
"jobs": {
"build": {
"name": "Build on ${{ matrix.platform }} with GHC ${{ matrix.ghc }}",
"runs-on": "${{ matrix.platform }}-${{ matrix.version }}",
"steps": [
{
"uses": "actions/checkout@v3"
},
{
"run": "mkdir artifact"
},
{
"id": "artifact",
"run": "echo 'directory=artifact/${{ matrix.platform }}-${{ matrix.ghc }}' >> $GITHUB_OUTPUT",
"shell": "bash"
},
{
"run": "mkdir ${{ steps.artifact.outputs.directory }}"
},
{
"id": "haskell",
"uses": "haskell/actions/setup@v2",
"with": {
"cabal-version": "3.8.1.0",
"ghc-version": "${{ matrix.ghc }}"
}
},
{
"run": "cabal sdist --output-dir ${{ steps.artifact.outputs.directory }}"
},
{
"run": "cabal configure --enable-optimization=2 --flags pedantic --jobs"
},
{
"run": "cat cabal.project.local"
},
{
"run": "cp cabal.project.local ${{ steps.artifact.outputs.directory }}"
},
{
"run": "cabal freeze"
},
{
"run": "cat cabal.project.freeze"
},
{
"run": "cp cabal.project.freeze ${{ steps.artifact.outputs.directory }}"
},
{
"run": "cabal outdated --v2-freeze-file cabal.project.freeze"
},
{
"uses": "actions/cache@v3",
"with": {
"key": "${{ matrix.platform }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}",
"path": "${{ steps.haskell.outputs.cabal-store }}",
"restore-keys": "${{ matrix.platform }}-${{ matrix.ghc }}-"
}
},
{
"run": "cabal build --only-download"
},
{
"run": "cabal build --only-dependencies"
},
{
"run": "cabal build"
},
{
"run": "cp \"$( cabal list-bin github-release )\" ${{ steps.artifact.outputs.directory }}"
},
{
"uses": "svenstaro/upx-action@v2",
"with": {
"files": "${{ steps.artifact.outputs.directory }}/github-release${{ matrix.extension }}"
}
},
{
"uses": "actions/upload-artifact@v3",
"with": {
"name": "github-release-${{ github.sha }}",
"path": "artifact"
}
}
],
"strategy": {
"matrix": {
"include": [
{
"ghc": "9.4.4",
"platform": "macos",
"version": "12"
},
{
"ghc": "9.0.2",
"platform": "ubuntu",
"version": "22.04"
},
{
"ghc": "9.2.5",
"platform": "ubuntu",
"version": "22.04"
},
{
"ghc": "9.4.4",
"platform": "ubuntu",
"version": "22.04"
},
{
"extension": ".exe",
"ghc": "9.4.4",
"platform": "windows",
"version": "2022"
}
]
}
}
},
"cabal": {
"name": "Cabal",
"runs-on": "ubuntu-22.04",
"steps": [
{
"uses": "actions/checkout@v3"
},
{
"run": "cabal check"
}
]
},
"hlint": {
"name": "HLint",
"runs-on": "ubuntu-22.04",
"steps": [
{
"uses": "actions/checkout@v3"
},
{
"uses": "haskell/actions/hlint-setup@v2",
"with": {
"version": 3.5
}
}
]
},
"ormolu": {
"name": "Ormolu",
"runs-on": "ubuntu-22.04",
"steps": [
{
"uses": "actions/checkout@v3"
},
{
"uses": "mrkkrp/ormolu-action@v10"
}
]
},
"release": {
"if": "github.event_name == 'release'",
"name": "Release",
"needs": "build",
"runs-on": "ubuntu-22.04",
"steps": [
{
"uses": "actions/download-artifact@v3",
"with": {
"name": "github-release-${{ github.sha }}",
"path": "artifact"
}
},
{
"uses": "svenstaro/upload-release-action@v2",
"with": {
"asset_name": "github-release-${{ github.event.release.tag_name }}-ubuntu",
"file": "artifact/ubuntu-9.4.4/github-release"
}
},
{
"uses": "svenstaro/upload-release-action@v2",
"with": {
"asset_name": "github-release-${{ github.event.release.tag_name }}-macos",
"file": "artifact/macos-9.4.4/github-release"
}
},
{
"uses": "svenstaro/upload-release-action@v2",
"with": {
"asset_name": "github-release-${{ github.event.release.tag_name }}-windows.exe",
"file": "artifact/windows-9.4.4/github-release.exe"
}
},
{
"uses": "svenstaro/upload-release-action@v2",
"with": {
"asset_name": "github-release-${{ github.event.release.tag_name }}.tar.gz",
"file": "artifact/ubuntu-9.4.4/github-release-${{ github.event.release.tag_name }}.tar.gz"
}
},
{
"run": "cabal upload --publish --username '${{ secrets.HACKAGE_USERNAME }}' --password '${{ secrets.HACKAGE_PASSWORD }}' artifact/ubuntu-9.4.4/github-release-${{ github.event.release.tag_name }}.tar.gz"
}
]
}
},
"name": "Workflow",
"on": {
"push": null,
"release": {
"types": [
"created"
]
},
"schedule": [
{
"cron": "0 0 * * *"
}
]
}
}
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/.stack-work/
/cabal.project.freeze
/cabal.project.local*
/.vscode/
/cabal.project.*
/dist-newstyle/
/stack.yaml.lock
Loading

0 comments on commit 48138d7

Please sign in to comment.