Skip to content

Commit 66c8527

Browse files
authored
Merge pull request #75 from maestro-org/chore/bump-artifact-action
chore: bump artifact action
2 parents 493f3d6 + aae0eb2 commit 66c8527

File tree

2 files changed

+166
-166
lines changed

2 files changed

+166
-166
lines changed

.github/workflows/haskell.yml

Lines changed: 106 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,113 @@
11
name: Haskell CI
22

33
on:
4-
workflow_call:
5-
outputs:
6-
MAESTRO_SDK_VERSION:
7-
description: "MAESTRO_SDK_VERSION"
8-
value: ${{ jobs.build.outputs.MAESTRO_SDK_VERSION }}
4+
workflow_call:
5+
outputs:
6+
MAESTRO_SDK_VERSION:
7+
description: "MAESTRO_SDK_VERSION"
8+
value: ${{ jobs.build.outputs.MAESTRO_SDK_VERSION }}
99

1010
permissions:
11-
contents: read
11+
contents: read
1212

1313
jobs:
14-
build:
15-
runs-on: ubuntu-22.04
16-
environment: build
17-
outputs:
18-
MAESTRO_SDK_VERSION: ${{ steps.get_maestro_sdk_version.outputs.MAESTRO_SDK_VERSION }}
19-
steps:
20-
- name: Checkout source code
21-
uses: actions/checkout@v3
22-
- name: Install dependencies (apt-get)
23-
run: |
24-
sudo apt-get update
25-
sudo apt-get install -y --no-install-recommends \
26-
autoconf \
27-
automake \
28-
build-essential \
29-
ca-certificates \
30-
chrony \
31-
dpkg-dev \
32-
gcc \
33-
gnupg \
34-
g++ \
35-
hlint \
36-
libc6-dev \
37-
libncursesw5 \
38-
libffi-dev \
39-
libgmp-dev \
40-
liblzma-dev \
41-
libnuma-dev \
42-
libpq-dev \
43-
libssl-dev \
44-
libsystemd-dev \
45-
libtinfo-dev \
46-
libtool \
47-
netbase \
48-
pkg-config \
49-
procps \
50-
tmux \
51-
xz-utils \
52-
zlib1g-dev
53-
- name: Setup haskell tooling
54-
uses: haskell/actions/setup@v2
55-
with:
56-
ghc-version: '8.10.7'
57-
cabal-version: '3.8'
58-
enable-stack: true
59-
stack-version: '2.9'
60-
- name: Setup cache
61-
uses: actions/cache@v3
62-
env:
63-
cache-name: cache-cabal
64-
with:
65-
path: ~/.cabal
66-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
67-
restore-keys: |
68-
${{ runner.os }}-build-${{ env.cache-name }}-
69-
${{ runner.os }}-build-
70-
${{ runner.os }}-
71-
- name: Update dependencies (cabal)
72-
run: cabal v2-update
73-
- name: Build dependencies (cabal)
74-
run: cabal v2-build --only-dependencies --enable-tests --enable-benchmarks
75-
- name: Build all targets (cabal)
76-
run: cabal v2-build --enable-tests --enable-benchmarks all
77-
# - name: Run all tests (cabal)
78-
# run: cabal v2-test maestro-sdk-tests
79-
- name: Run doctest (docspec)
80-
run: |
81-
# Install docspec and run doctests.
82-
echo "=========================[ INSTALL DOCSPEC ]========================"
83-
echo " -> Started at $(date --iso-8601=seconds --utc)."
84-
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
85-
xz -d < ./cabal-docspec.xz > ./cabal-docspec
86-
rm -f ./cabal-docspec.xz
87-
chmod a+x ./cabal-docspec
88-
echo " -> Docspec has been installed."
89-
echo "===========================[ RUN DOCSPEC ]==========================="
90-
./cabal-docspec
91-
echo " ============================[ FINISHED ]============================"
92-
- name: Run checks (cabal)
93-
run: cabal check
94-
- name: Create source distribution file (cabal)
95-
run: cabal sdist
96-
- name: Identify maestro sdk version (cabal)
97-
id: get_maestro_sdk_version
98-
run: |
99-
export MAESTRO_SDK_VERSION=$(cabal info . | awk '{print $2 ;exit}') ;
100-
echo "MAESTRO_SDK_VERSION: $MAESTRO_SDK_VERSION"
101-
echo "MAESTRO_SDK_VERSION=${MAESTRO_SDK_VERSION}" >> $GITHUB_ENV
102-
echo "MAESTRO_SDK_VERSION=${MAESTRO_SDK_VERSION}" >> $GITHUB_OUTPUT
103-
- name: Generate documentation (cabal haddock)
104-
run: cabal haddock --html --hyperlink-source --haddock-options="--use-unicode"
105-
- name: Upload haddock documentation
106-
uses: actions/upload-pages-artifact@v1.0.8
107-
with:
108-
path: ./dist-newstyle/build/x86_64-linux/ghc-8.10.7/${{env.MAESTRO_SDK_VERSION}}/doc/html/maestro-sdk/
109-
- name: Upload artifacts
110-
uses: actions/upload-artifact@v3
111-
with:
112-
name: source-distribution-file
113-
path: ./dist-newstyle/sdist/${{env.MAESTRO_SDK_VERSION}}.tar.gz
14+
build:
15+
runs-on: ubuntu-22.04
16+
environment: build
17+
outputs:
18+
MAESTRO_SDK_VERSION: ${{ steps.get_maestro_sdk_version.outputs.MAESTRO_SDK_VERSION }}
19+
steps:
20+
- name: Checkout source code
21+
uses: actions/checkout@v3
22+
- name: Install dependencies (apt-get)
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y --no-install-recommends \
26+
autoconf \
27+
automake \
28+
build-essential \
29+
ca-certificates \
30+
chrony \
31+
dpkg-dev \
32+
gcc \
33+
gnupg \
34+
g++ \
35+
hlint \
36+
libc6-dev \
37+
libncursesw5 \
38+
libffi-dev \
39+
libgmp-dev \
40+
liblzma-dev \
41+
libnuma-dev \
42+
libpq-dev \
43+
libssl-dev \
44+
libsystemd-dev \
45+
libtinfo-dev \
46+
libtool \
47+
netbase \
48+
pkg-config \
49+
procps \
50+
tmux \
51+
xz-utils \
52+
zlib1g-dev
53+
- name: Setup haskell tooling
54+
uses: haskell/actions/setup@v2
55+
with:
56+
ghc-version: "8.10.7"
57+
cabal-version: "3.8"
58+
enable-stack: true
59+
stack-version: "2.9"
60+
- name: Setup cache
61+
uses: actions/cache@v3
62+
env:
63+
cache-name: cache-cabal
64+
with:
65+
path: ~/.cabal
66+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
67+
restore-keys: |
68+
${{ runner.os }}-build-${{ env.cache-name }}-
69+
${{ runner.os }}-build-
70+
${{ runner.os }}-
71+
- name: Update dependencies (cabal)
72+
run: cabal v2-update
73+
- name: Build dependencies (cabal)
74+
run: cabal v2-build --only-dependencies --enable-tests --enable-benchmarks
75+
- name: Build all targets (cabal)
76+
run: cabal v2-build --enable-tests --enable-benchmarks all
77+
# - name: Run all tests (cabal)
78+
# run: cabal v2-test maestro-sdk-tests
79+
- name: Run doctest (docspec)
80+
run: |
81+
# Install docspec and run doctests.
82+
echo "=========================[ INSTALL DOCSPEC ]========================"
83+
echo " -> Started at $(date --iso-8601=seconds --utc)."
84+
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
85+
xz -d < ./cabal-docspec.xz > ./cabal-docspec
86+
rm -f ./cabal-docspec.xz
87+
chmod a+x ./cabal-docspec
88+
echo " -> Docspec has been installed."
89+
echo "===========================[ RUN DOCSPEC ]==========================="
90+
./cabal-docspec
91+
echo " ============================[ FINISHED ]============================"
92+
- name: Run checks (cabal)
93+
run: cabal check
94+
- name: Create source distribution file (cabal)
95+
run: cabal sdist
96+
- name: Identify maestro sdk version (cabal)
97+
id: get_maestro_sdk_version
98+
run: |
99+
export MAESTRO_SDK_VERSION=$(cabal info . | awk '{print $2 ;exit}') ;
100+
echo "MAESTRO_SDK_VERSION: $MAESTRO_SDK_VERSION"
101+
echo "MAESTRO_SDK_VERSION=${MAESTRO_SDK_VERSION}" >> $GITHUB_ENV
102+
echo "MAESTRO_SDK_VERSION=${MAESTRO_SDK_VERSION}" >> $GITHUB_OUTPUT
103+
- name: Generate documentation (cabal haddock)
104+
run: cabal haddock --html --hyperlink-source --haddock-options="--use-unicode"
105+
- name: Upload haddock documentation
106+
uses: actions/upload-pages-artifact@v3
107+
with:
108+
path: ./dist-newstyle/build/x86_64-linux/ghc-8.10.7/${{env.MAESTRO_SDK_VERSION}}/doc/html/maestro-sdk/
109+
- name: Upload artifacts
110+
uses: actions/upload-artifact@v4
111+
with:
112+
name: source-distribution-file
113+
path: ./dist-newstyle/sdist/${{env.MAESTRO_SDK_VERSION}}.tar.gz

.github/workflows/release.yml

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,67 @@
11
name: Release
22

33
on:
4-
push:
5-
tags:
6-
- "v*"
4+
push:
5+
tags:
6+
- "v*"
77

88
permissions:
9-
contents: write
9+
contents: write
1010

1111
jobs:
12-
build:
13-
uses: ./.github/workflows/haskell.yml
14-
release:
15-
runs-on: ubuntu-22.04
16-
needs: build
17-
steps:
18-
- name: Checkout source code
19-
uses: actions/checkout@v3
20-
- uses: actions/download-artifact@v3
21-
name: Download source distribution file artifact
22-
with:
23-
name: source-distribution-file
24-
path: ./artifacts
25-
- uses: actions/download-artifact@v3
26-
name: Download haddock artifact
27-
with:
28-
name: github-pages
29-
path: ./artifacts
30-
- name: Create release draft (GitHub)
31-
env:
32-
MAESTRO_SDK_VERSION: ${{needs.build.outputs.MAESTRO_SDK_VERSION}}
33-
run: |
34-
export GH_TOKEN=${{ secrets.GITHUB_TOKEN }}
35-
SEMANTIC_VERSION=v${MAESTRO_SDK_VERSION/#maestro-sdk-}
36-
TAGS=$(git describe --tags)
37-
GIT_REVISION=$(git rev-parse HEAD)
38-
CI_BUILD_TIME=$(date --iso-8601=seconds --utc)
39-
echo "MAESTRO_SDK_VERSION: ${{ env.MAESTRO_SDK_VERSION }}"
40-
echo "SEMANTIC_VERSION: $SEMANTIC_VERSION"
41-
echo "TAGS: $TAGS"
42-
echo "GIT_REVISION: $GIT_REVISION"
43-
echo "CI_BUILD_TIME: $CI_BUILD_TIME"
44-
HADDOCK_FILE=${{ env.MAESTRO_SDK_VERSION }}-haddock.tar
45-
set -x
46-
mv ./artifacts/artifact.tar ./artifacts/${HADDOCK_FILE}
47-
gh release create \
48-
--generate-notes \
49-
--verify-tag \
50-
--draft \
51-
"${SEMANTIC_VERSION}" \
52-
"./artifacts/${{ env.MAESTRO_SDK_VERSION }}.tar.gz#Source distribution file (tar.gz)" \
53-
"./artifacts/${HADDOCK_FILE}#Haddock (tar)"
54-
echo "::notice::Succesfully created release draft ${SEMANTIC_VERSION} from ${GIT_REVISION}. (Uploaded: ${{ env.MAESTRO_SDK_VERSION }}.tar.gz)"
55-
- name: Setup haskell tooling
56-
uses: haskell/actions/setup@v2
57-
with:
58-
ghc-version: "8.10.7"
59-
cabal-version: "3.8"
60-
enable-stack: true
61-
- name: Update dependencies (cabal)
62-
run: cabal v2-update
63-
- uses: haskell-actions/hackage-publish@v1
64-
with:
65-
hackageToken: ${{ secrets.HACKAGE_AUTH_TOKEN }}
66-
packagesPath: ${{ runner.temp }}/
67-
publish: false
12+
build:
13+
uses: ./.github/workflows/haskell.yml
14+
release:
15+
runs-on: ubuntu-22.04
16+
needs: build
17+
steps:
18+
- name: Checkout source code
19+
uses: actions/checkout@v3
20+
- uses: actions/download-artifact@v4
21+
name: Download source distribution file artifact
22+
with:
23+
name: source-distribution-file
24+
path: ./artifacts
25+
- uses: actions/download-artifact@v4
26+
name: Download haddock artifact
27+
with:
28+
name: github-pages
29+
path: ./artifacts
30+
- name: Create release draft (GitHub)
31+
env:
32+
MAESTRO_SDK_VERSION: ${{needs.build.outputs.MAESTRO_SDK_VERSION}}
33+
run: |
34+
export GH_TOKEN=${{ secrets.GITHUB_TOKEN }}
35+
SEMANTIC_VERSION=v${MAESTRO_SDK_VERSION/#maestro-sdk-}
36+
TAGS=$(git describe --tags)
37+
GIT_REVISION=$(git rev-parse HEAD)
38+
CI_BUILD_TIME=$(date --iso-8601=seconds --utc)
39+
echo "MAESTRO_SDK_VERSION: ${{ env.MAESTRO_SDK_VERSION }}"
40+
echo "SEMANTIC_VERSION: $SEMANTIC_VERSION"
41+
echo "TAGS: $TAGS"
42+
echo "GIT_REVISION: $GIT_REVISION"
43+
echo "CI_BUILD_TIME: $CI_BUILD_TIME"
44+
HADDOCK_FILE=${{ env.MAESTRO_SDK_VERSION }}-haddock.tar
45+
set -x
46+
mv ./artifacts/artifact.tar ./artifacts/${HADDOCK_FILE}
47+
gh release create \
48+
--generate-notes \
49+
--verify-tag \
50+
--draft \
51+
"${SEMANTIC_VERSION}" \
52+
"./artifacts/${{ env.MAESTRO_SDK_VERSION }}.tar.gz#Source distribution file (tar.gz)" \
53+
"./artifacts/${HADDOCK_FILE}#Haddock (tar)"
54+
echo "::notice::Succesfully created release draft ${SEMANTIC_VERSION} from ${GIT_REVISION}. (Uploaded: ${{ env.MAESTRO_SDK_VERSION }}.tar.gz)"
55+
- name: Setup haskell tooling
56+
uses: haskell/actions/setup@v2
57+
with:
58+
ghc-version: "8.10.7"
59+
cabal-version: "3.8"
60+
enable-stack: true
61+
- name: Update dependencies (cabal)
62+
run: cabal v2-update
63+
- uses: haskell-actions/hackage-publish@v1
64+
with:
65+
hackageToken: ${{ secrets.HACKAGE_AUTH_TOKEN }}
66+
packagesPath: ${{ runner.temp }}/
67+
publish: false

0 commit comments

Comments
 (0)