-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
459de39
commit 4aa1dd8
Showing
7 changed files
with
296 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.stack-work |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- "*.*.*" | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Run tests | ||
run: stack test | ||
|
||
build-linux: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Compile binary | ||
run: stack --local-bin-path=build/bin install | ||
|
||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: parthenon-Linux-x86-64 | ||
path: build/bin/parthenon | ||
retention-days: 3 | ||
|
||
build-macos: | ||
needs: test | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Compile binary | ||
run: stack --local-bin-path=build/bin install | ||
|
||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: parthenon-Darwin-x86_64 | ||
path: build/bin/parthenon | ||
retention-days: 3 | ||
|
||
build-windows: | ||
needs: test | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Compile binary | ||
run: stack --local-bin-path=build/bin install | ||
|
||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: parthenon-Windows-x86_64.exe | ||
path: build/bin/parthenon.exe | ||
retention-days: 3 | ||
|
||
docker: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | ||
|
||
- name: Push Docker Image Scratch | ||
uses: docker/build-push-action@v3 | ||
with: | ||
push: true | ||
tags: | | ||
parthenon/parthenon:latest | ||
parthenon/parthenon:${{github.ref}} | ||
parthenon/parthenon:${{github.sha}} | ||
create-release: | ||
needs: [build-linux, build-macos, build-windows] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Download Artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
path: assets/ | ||
|
||
- name: Display structure of downloaded files | ||
run: ls -lR | ||
working-directory: assets/ | ||
|
||
- name: Upload Release Assets | ||
id: upload_release_assets | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./assets/parthenon-Linux-x86_64/parthenon | ||
asset_name: parthenon-Linux-x86_64 | ||
asset_content_type: application/octet-stream | ||
|
||
- uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./assets/parthenon-Darwin-x86_64/parthenon | ||
asset_name: parthenon-Darwin-x86_64 | ||
asset_content_type: application/octet-stream | ||
|
||
- uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./assets/parthenon-Windows-x86_64/parthenon | ||
asset_name: parthenon-Windows-x86_64 | ||
asset_content_type: application/octet-stream |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM haskell:9-slim as builder | ||
WORKDIR /tmp/parthenon | ||
RUN cabal update | ||
|
||
COPY parthenon.cabal /tmp/parthenon/ | ||
RUN cabal build --only-dependencies -j4 | ||
|
||
COPY . /tmp/parthenon/ | ||
RUN cabal install | ||
|
||
FROM scratch | ||
LABEL maintainer="Antoine Gagné <gagnantoine@gmail.com>" | ||
COPY --from=builder /root/.cabal/bin/parthenon /usr/bin/ | ||
ENTRYPOINT ["parthenon"] |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.