Skip to content

Commit

Permalink
Merge pull request #75 from maestro-org/chore/bump-artifact-action
Browse files Browse the repository at this point in the history
chore: bump artifact action
  • Loading branch information
Vardominator authored Feb 22, 2025
2 parents 493f3d6 + aae0eb2 commit 66c8527
Show file tree
Hide file tree
Showing 2 changed files with 166 additions and 166 deletions.
212 changes: 106 additions & 106 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
@@ -1,113 +1,113 @@
name: Haskell CI

on:
workflow_call:
outputs:
MAESTRO_SDK_VERSION:
description: "MAESTRO_SDK_VERSION"
value: ${{ jobs.build.outputs.MAESTRO_SDK_VERSION }}
workflow_call:
outputs:
MAESTRO_SDK_VERSION:
description: "MAESTRO_SDK_VERSION"
value: ${{ jobs.build.outputs.MAESTRO_SDK_VERSION }}

permissions:
contents: read
contents: read

jobs:
build:
runs-on: ubuntu-22.04
environment: build
outputs:
MAESTRO_SDK_VERSION: ${{ steps.get_maestro_sdk_version.outputs.MAESTRO_SDK_VERSION }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Install dependencies (apt-get)
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
autoconf \
automake \
build-essential \
ca-certificates \
chrony \
dpkg-dev \
gcc \
gnupg \
g++ \
hlint \
libc6-dev \
libncursesw5 \
libffi-dev \
libgmp-dev \
liblzma-dev \
libnuma-dev \
libpq-dev \
libssl-dev \
libsystemd-dev \
libtinfo-dev \
libtool \
netbase \
pkg-config \
procps \
tmux \
xz-utils \
zlib1g-dev
- name: Setup haskell tooling
uses: haskell/actions/setup@v2
with:
ghc-version: '8.10.7'
cabal-version: '3.8'
enable-stack: true
stack-version: '2.9'
- name: Setup cache
uses: actions/cache@v3
env:
cache-name: cache-cabal
with:
path: ~/.cabal
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Update dependencies (cabal)
run: cabal v2-update
- name: Build dependencies (cabal)
run: cabal v2-build --only-dependencies --enable-tests --enable-benchmarks
- name: Build all targets (cabal)
run: cabal v2-build --enable-tests --enable-benchmarks all
# - name: Run all tests (cabal)
# run: cabal v2-test maestro-sdk-tests
- name: Run doctest (docspec)
run: |
# Install docspec and run doctests.
echo "=========================[ INSTALL DOCSPEC ]========================"
echo " -> Started at $(date --iso-8601=seconds --utc)."
curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20211114/cabal-docspec-0.0.0.20211114.xz > ./cabal-docspec.xz
xz -d < ./cabal-docspec.xz > ./cabal-docspec
rm -f ./cabal-docspec.xz
chmod a+x ./cabal-docspec
echo " -> Docspec has been installed."
echo "===========================[ RUN DOCSPEC ]==========================="
./cabal-docspec
echo " ============================[ FINISHED ]============================"
- name: Run checks (cabal)
run: cabal check
- name: Create source distribution file (cabal)
run: cabal sdist
- name: Identify maestro sdk version (cabal)
id: get_maestro_sdk_version
run: |
export MAESTRO_SDK_VERSION=$(cabal info . | awk '{print $2 ;exit}') ;
echo "MAESTRO_SDK_VERSION: $MAESTRO_SDK_VERSION"
echo "MAESTRO_SDK_VERSION=${MAESTRO_SDK_VERSION}" >> $GITHUB_ENV
echo "MAESTRO_SDK_VERSION=${MAESTRO_SDK_VERSION}" >> $GITHUB_OUTPUT
- name: Generate documentation (cabal haddock)
run: cabal haddock --html --hyperlink-source --haddock-options="--use-unicode"
- name: Upload haddock documentation
uses: actions/upload-pages-artifact@v1.0.8
with:
path: ./dist-newstyle/build/x86_64-linux/ghc-8.10.7/${{env.MAESTRO_SDK_VERSION}}/doc/html/maestro-sdk/
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: source-distribution-file
path: ./dist-newstyle/sdist/${{env.MAESTRO_SDK_VERSION}}.tar.gz
build:
runs-on: ubuntu-22.04
environment: build
outputs:
MAESTRO_SDK_VERSION: ${{ steps.get_maestro_sdk_version.outputs.MAESTRO_SDK_VERSION }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Install dependencies (apt-get)
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
autoconf \
automake \
build-essential \
ca-certificates \
chrony \
dpkg-dev \
gcc \
gnupg \
g++ \
hlint \
libc6-dev \
libncursesw5 \
libffi-dev \
libgmp-dev \
liblzma-dev \
libnuma-dev \
libpq-dev \
libssl-dev \
libsystemd-dev \
libtinfo-dev \
libtool \
netbase \
pkg-config \
procps \
tmux \
xz-utils \
zlib1g-dev
- name: Setup haskell tooling
uses: haskell/actions/setup@v2
with:
ghc-version: "8.10.7"
cabal-version: "3.8"
enable-stack: true
stack-version: "2.9"
- name: Setup cache
uses: actions/cache@v3
env:
cache-name: cache-cabal
with:
path: ~/.cabal
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Update dependencies (cabal)
run: cabal v2-update
- name: Build dependencies (cabal)
run: cabal v2-build --only-dependencies --enable-tests --enable-benchmarks
- name: Build all targets (cabal)
run: cabal v2-build --enable-tests --enable-benchmarks all
# - name: Run all tests (cabal)
# run: cabal v2-test maestro-sdk-tests
- name: Run doctest (docspec)
run: |
# Install docspec and run doctests.
echo "=========================[ INSTALL DOCSPEC ]========================"
echo " -> Started at $(date --iso-8601=seconds --utc)."
curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20211114/cabal-docspec-0.0.0.20211114.xz > ./cabal-docspec.xz
xz -d < ./cabal-docspec.xz > ./cabal-docspec
rm -f ./cabal-docspec.xz
chmod a+x ./cabal-docspec
echo " -> Docspec has been installed."
echo "===========================[ RUN DOCSPEC ]==========================="
./cabal-docspec
echo " ============================[ FINISHED ]============================"
- name: Run checks (cabal)
run: cabal check
- name: Create source distribution file (cabal)
run: cabal sdist
- name: Identify maestro sdk version (cabal)
id: get_maestro_sdk_version
run: |
export MAESTRO_SDK_VERSION=$(cabal info . | awk '{print $2 ;exit}') ;
echo "MAESTRO_SDK_VERSION: $MAESTRO_SDK_VERSION"
echo "MAESTRO_SDK_VERSION=${MAESTRO_SDK_VERSION}" >> $GITHUB_ENV
echo "MAESTRO_SDK_VERSION=${MAESTRO_SDK_VERSION}" >> $GITHUB_OUTPUT
- name: Generate documentation (cabal haddock)
run: cabal haddock --html --hyperlink-source --haddock-options="--use-unicode"
- name: Upload haddock documentation
uses: actions/upload-pages-artifact@v3
with:
path: ./dist-newstyle/build/x86_64-linux/ghc-8.10.7/${{env.MAESTRO_SDK_VERSION}}/doc/html/maestro-sdk/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: source-distribution-file
path: ./dist-newstyle/sdist/${{env.MAESTRO_SDK_VERSION}}.tar.gz
120 changes: 60 additions & 60 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
name: Release

on:
push:
tags:
- "v*"
push:
tags:
- "v*"

permissions:
contents: write
contents: write

jobs:
build:
uses: ./.github/workflows/haskell.yml
release:
runs-on: ubuntu-22.04
needs: build
steps:
- name: Checkout source code
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
name: Download source distribution file artifact
with:
name: source-distribution-file
path: ./artifacts
- uses: actions/download-artifact@v3
name: Download haddock artifact
with:
name: github-pages
path: ./artifacts
- name: Create release draft (GitHub)
env:
MAESTRO_SDK_VERSION: ${{needs.build.outputs.MAESTRO_SDK_VERSION}}
run: |
export GH_TOKEN=${{ secrets.GITHUB_TOKEN }}
SEMANTIC_VERSION=v${MAESTRO_SDK_VERSION/#maestro-sdk-}
TAGS=$(git describe --tags)
GIT_REVISION=$(git rev-parse HEAD)
CI_BUILD_TIME=$(date --iso-8601=seconds --utc)
echo "MAESTRO_SDK_VERSION: ${{ env.MAESTRO_SDK_VERSION }}"
echo "SEMANTIC_VERSION: $SEMANTIC_VERSION"
echo "TAGS: $TAGS"
echo "GIT_REVISION: $GIT_REVISION"
echo "CI_BUILD_TIME: $CI_BUILD_TIME"
HADDOCK_FILE=${{ env.MAESTRO_SDK_VERSION }}-haddock.tar
set -x
mv ./artifacts/artifact.tar ./artifacts/${HADDOCK_FILE}
gh release create \
--generate-notes \
--verify-tag \
--draft \
"${SEMANTIC_VERSION}" \
"./artifacts/${{ env.MAESTRO_SDK_VERSION }}.tar.gz#Source distribution file (tar.gz)" \
"./artifacts/${HADDOCK_FILE}#Haddock (tar)"
echo "::notice::Succesfully created release draft ${SEMANTIC_VERSION} from ${GIT_REVISION}. (Uploaded: ${{ env.MAESTRO_SDK_VERSION }}.tar.gz)"
- name: Setup haskell tooling
uses: haskell/actions/setup@v2
with:
ghc-version: "8.10.7"
cabal-version: "3.8"
enable-stack: true
- name: Update dependencies (cabal)
run: cabal v2-update
- uses: haskell-actions/hackage-publish@v1
with:
hackageToken: ${{ secrets.HACKAGE_AUTH_TOKEN }}
packagesPath: ${{ runner.temp }}/
publish: false
build:
uses: ./.github/workflows/haskell.yml
release:
runs-on: ubuntu-22.04
needs: build
steps:
- name: Checkout source code
uses: actions/checkout@v3
- uses: actions/download-artifact@v4
name: Download source distribution file artifact
with:
name: source-distribution-file
path: ./artifacts
- uses: actions/download-artifact@v4
name: Download haddock artifact
with:
name: github-pages
path: ./artifacts
- name: Create release draft (GitHub)
env:
MAESTRO_SDK_VERSION: ${{needs.build.outputs.MAESTRO_SDK_VERSION}}
run: |
export GH_TOKEN=${{ secrets.GITHUB_TOKEN }}
SEMANTIC_VERSION=v${MAESTRO_SDK_VERSION/#maestro-sdk-}
TAGS=$(git describe --tags)
GIT_REVISION=$(git rev-parse HEAD)
CI_BUILD_TIME=$(date --iso-8601=seconds --utc)
echo "MAESTRO_SDK_VERSION: ${{ env.MAESTRO_SDK_VERSION }}"
echo "SEMANTIC_VERSION: $SEMANTIC_VERSION"
echo "TAGS: $TAGS"
echo "GIT_REVISION: $GIT_REVISION"
echo "CI_BUILD_TIME: $CI_BUILD_TIME"
HADDOCK_FILE=${{ env.MAESTRO_SDK_VERSION }}-haddock.tar
set -x
mv ./artifacts/artifact.tar ./artifacts/${HADDOCK_FILE}
gh release create \
--generate-notes \
--verify-tag \
--draft \
"${SEMANTIC_VERSION}" \
"./artifacts/${{ env.MAESTRO_SDK_VERSION }}.tar.gz#Source distribution file (tar.gz)" \
"./artifacts/${HADDOCK_FILE}#Haddock (tar)"
echo "::notice::Succesfully created release draft ${SEMANTIC_VERSION} from ${GIT_REVISION}. (Uploaded: ${{ env.MAESTRO_SDK_VERSION }}.tar.gz)"
- name: Setup haskell tooling
uses: haskell/actions/setup@v2
with:
ghc-version: "8.10.7"
cabal-version: "3.8"
enable-stack: true
- name: Update dependencies (cabal)
run: cabal v2-update
- uses: haskell-actions/hackage-publish@v1
with:
hackageToken: ${{ secrets.HACKAGE_AUTH_TOKEN }}
packagesPath: ${{ runner.temp }}/
publish: false

0 comments on commit 66c8527

Please sign in to comment.