Skip to content

Commit

Permalink
Merge pull request #45 from SamirTalwar/release
Browse files Browse the repository at this point in the history
  • Loading branch information
SamirTalwar authored Aug 16, 2020
2 parents a0e0be1 + 276164a commit 7b9c965
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 75 deletions.
50 changes: 17 additions & 33 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,19 @@ on:
jobs:
release:
name: Release
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
outputs:
release_upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- id: create_release
uses: actions/create-release@latest
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: ${{ github.ref }}
draft: true
- run: echo "${{ steps.create_release.outputs.upload_url }}" > release_upload_url.txt
- uses: actions/upload-artifact@v1
with:
name: release_upload_url
path: release_upload_url.txt

publish-unix:
name: Release
Expand All @@ -31,45 +28,32 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-latest
- ubuntu-20.04
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v7
- uses: cachix/cachix-action@v5
- uses: actions/setup-haskell@v1
with:
name: samirtalwar
signingKey: ${{ secrets.CACHIX_SIGNING_KEY }}
- run: nix-instantiate shell.nix | cachix push samirtalwar
env:
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
# - uses: actions/cache@v2
# with:
# path: ~/.stack
# key: v1-${{ matrix.os }}-stack-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}
- uses: actions/download-artifact@v1
ghc-version: "8.8.3"
enable-stack: true
stack-no-global: true
- uses: actions/cache@v2
with:
name: release_upload_url
- id: release
run: |
echo ::set-output name=upload_url::"$(cat release_upload_url/release_upload_url.txt)"
path: ~/.stack/snapshots
key: v1-${{ matrix.os }}-stack-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}
- run: make smoke.cabal
- run: make out/build/release/smoke
- id: asset
run: |
export TAG="${{ github.ref }}"
export ASSET_NAME="smoke-${TAG##*/}-$(uname -s)-$(uname -m)"
echo ::set-output name=asset_name::"$ASSET_NAME"
echo ::set-output name=asset_path::"out/publish/${ASSET_NAME}"
- run: nix-shell --pure --keep LANG ./nix/ci.nix --run 'make smoke.cabal'
- run: nix-shell --pure --keep LANG ./nix/ci.nix --run 'make out/build/release/smoke'
- run: |
mkdir -p "$(dirname ${{ steps.asset.outputs.asset_path }})"
cp out/build/release/smoke ${{ steps.asset.outputs.asset_path }}
echo "::set-output name=asset_name::smoke-${TAG##*/}-$(uname -s)-$(uname -m)"
echo "::set-output name=asset_path::out/build/release/smoke"
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
upload_url: ${{ needs.release.outputs.release_upload_url }}
asset_name: ${{ steps.asset.outputs.asset_name }}
asset_path: ${{ steps.asset.outputs.asset_path }}
asset_content_type: application/octet-stream
65 changes: 23 additions & 42 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,22 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-latest
- ubuntu-20.04
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v10
- uses: cachix/cachix-action@v6
- uses: actions/setup-haskell@v1
with:
name: samirtalwar
signingKey: ${{ secrets.CACHIX_SIGNING_KEY }}
- run: |
if [[ -n "$CACHIX_SIGNING_KEY" ]]; then
nix-instantiate shell.nix | cachix push samirtalwar
else
nix-instantiate shell.nix
fi
env:
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
# - uses: actions/cache@v2
# with:
# path: ~/.stack
# key: v1-${{ matrix.os }}-stack-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}
- run: |
mkdir -p ~/.stack
cat > ~/.stack/config.yaml <<EOF
nix:
enable: true
EOF
- run: nix-shell --pure --keep LANG ./nix/ci.nix --run 'make smoke.cabal'
- run: nix-shell --pure --keep LANG ./nix/ci.nix --run 'make build'
ghc-version: "8.8.3"
enable-stack: true
stack-no-global: true
- uses: actions/cache@v2
with:
path: ~/.stack/snapshots
key: v1-${{ matrix.os }}-stack-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}
- run: make smoke.cabal
- run: make build

test-unix:
name: Build and Test
Expand All @@ -48,32 +34,27 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-latest
- ubuntu-20.04
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v10
- uses: cachix/cachix-action@v6
- uses: actions/setup-haskell@v1
with:
name: samirtalwar
# - uses: actions/cache@v2
# with:
# path: ~/.stack
# key: v1-${{ matrix.os }}-stack-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}
- run: |
mkdir -p ~/.stack
cat > ~/.stack/config.yaml <<EOF
nix:
enable: true
EOF
- run: nix-shell --pure --keep LANG ./nix/ci.nix --run 'make smoke.cabal'
- run: nix-shell --pure --keep LANG ./nix/ci.nix --run 'make test'
ghc-version: "8.8.3"
enable-stack: true
stack-no-global: true
- uses: actions/cache@v2
with:
path: ~/.stack/snapshots
key: v1-${{ matrix.os }}-stack-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}
- run: make smoke.cabal
- run: make test

lint:
name: Lint
needs: build-unix
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v10
Expand Down

0 comments on commit 7b9c965

Please sign in to comment.