bump cloudformation version: 65 -> 153 (#17) #78
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
name: Build and Test | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
type: [ synchronize ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, 'ci skip')" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Dhall | |
uses: dhall-lang/setup-dhall@v4 | |
with: | |
version: '1.42.0' | |
- uses: cachix/install-nix-action@v20 | |
with: | |
nix_path: nixpkgs=channel:nixos-23.05 | |
extra_nix_config: | | |
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= | |
substituters = https://cache.iog.io https://cache.nixos.org/ | |
- uses: cachix/cachix-action@v12 | |
with: | |
name: jcouyang | |
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
- name: Dhall test | |
run: | | |
dhall-to-yaml <<< "./examples/dynamo.dhall" | |
nix-build ./examples/example0.nix --no-out-link | |
- name: Haskell test | |
run: nix-build ./nix/haskell.nix -A dhall-aws-cloudformation.components.tests.dhall-aws-cloudformation-test --no-out-link | |
docs: | |
runs-on: ubuntu-latest | |
if: "github.ref == 'refs/heads/master'" | |
needs: | |
- test | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: cachix/install-nix-action@v20 | |
with: | |
nix_path: nixpkgs=channel:nixos-23.05 | |
- name: Checkout Docs | |
uses: actions/checkout@v2 | |
with: | |
ref: gh-pages | |
path: gh-pages | |
- name: build | |
run: | | |
VERSION=$(nix-shell -p dhall --run 'dhall text < ./version.dhall') | |
nix-shell -p dhall-docs --run "dhall-docs --input . --base-import-url 'https://raw.githubusercontent.com/jcouyang/dhall-aws-cloudformation/'"$VERSION" --package-name dhall-aws-cloudformation --version $VERSION" | |
cp -r docs/* gh-pages/ | |
cd gh-pages | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git add . | |
git commit -m "generated doc" | |
git push | |
publish: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, 'publish skip') && (github.ref == 'refs/heads/master')" | |
needs: | |
- test | |
permissions: | |
packages: write | |
contents: write | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: cachix/install-nix-action@v20 | |
with: | |
nix_path: nixpkgs=channel:nixos-23.05 | |
extra_nix_config: | | |
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= | |
substituters = https://cache.iog.io https://cache.nixos.org/ | |
- uses: cachix/cachix-action@v12 | |
with: | |
name: jcouyang | |
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
- name: Log in to the Container registry | |
uses: docker/login-action@v1.10.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: publish docker image | |
run: | | |
$(nix-build ./nix/docker.nix) | docker load | |
LOCAL_VERSION=$(nix-shell -p dhall --run 'dhall text < ./version.dhall') | |
docker tag ghcr.io/jcouyang/dhall-aws-cloudformation:latest ghcr.io/jcouyang/dhall-aws-cloudformation:$LOCAL_VERSION | |
docker push ghcr.io/jcouyang/dhall-aws-cloudformation:latest | |
docker push ghcr.io/jcouyang/dhall-aws-cloudformation:$LOCAL_VERSION | |
- name: tag release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
LAST_RELEASE=$(hub release -L 1) | |
LOCAL_VERSION=$(dhall text < ./version.dhall) | |
echo "main version is $LAST_RELEASE and current version is $LOCAL_VERSION" | |
if [ ${LAST_RELEASE:-0} != $LOCAL_VERSION ];then | |
hub release create -m "${LOCAL_VERSION}" "${LOCAL_VERSION}" | |
fi | |
- name: publish doc | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
bin/gen-readme.sh | |
git add README.md | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git commit --allow-empty -m "update readme [ci skip]" | |
git push |