Skip to content

ci: fix

ci: fix #2

Workflow file for this run

name: Release
permissions:
contents: write
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
jobs:
versionning:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.snapshot.outputs.version }}
release: ${{ steps.release.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Remove tag locally
# This is done so that codacy/git-version can compute the version of the images deployed on docker hub
run: |
git tag -d ${{ github.ref_name }}
- name: Compute branch for codacy
# This is the branch to give to codacy to compute the snapshot version
id: rev
run: |
export CURRENT_BRANCH=$(git describe --tags)
echo "current-branch=$CURRENT_BRANCH" >> $GITHUB_OUTPUT
- name: Generate Snapshot Version
id: snapshot
uses: codacy/git-version@80c816f11db8dea5e3a81025f598193015b51832 # 2.8.0
with:
minor-identifier: "feat:"
release-branch: ${{ github.ref_name }}-pre
dev-branch: ${{ steps.rev.outputs.current-branch }}
- name: Generate Release Version
id: release
uses: codacy/git-version@80c816f11db8dea5e3a81025f598193015b51832 # 2.8.0
with:
minor-identifier: "feat:"
release-branch: ${{ steps.rev.outputs.current-branch }}
dev-branch: main
- name: Put versions in step summary
run: |
echo SNAPSHOT => ${{ steps.snapshot.outputs.version }} >> $GITHUB_STEP_SUMMARY
echo RELASE => ${{ steps.release.outputs.version }} >> $GITHUB_STEP_SUMMARY
- name: Validate tag
run : test ${{ steps.release.outputs.version }} == ${{ github.ref_name }}
- name: Delete tag if invalid
if: failure() || cancelled()
run : git push origin -d ${{ github.ref_name }}
imagesCore:
runs-on: ubuntu-latest
needs:
- versionning
env:
VERSION: ${{ needs.versionning.outputs.release }}
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
with:
ref: ${{ github.ref }}
submodules: true
- name: Setup just
run: |
sudo snap install --edge --classic just
- name: login
run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_LOGIN }} --password-stdin
- name: Build
run: |
just tag=$VERSION platform="linux/arm64,linux/amd64" build-core
buildImages:
runs-on: ubuntu-latest
needs:
- versionning
strategy:
fail-fast: false
matrix:
include:
- img : dockerhubaneo/armonik_core_stream_test_worker
path: ./Tests/Stream/Server/Dockerfile
- img : dockerhubaneo/armonik_core_stream_test_client
path: ./Tests/Stream/Client/Dockerfile
- img : dockerhubaneo/armonik_core_htcmock_test_worker
path: ./Tests/HtcMock/Server/src/Dockerfile
- img : dockerhubaneo/armonik_core_htcmock_test_client
path: ./Tests/HtcMock/Client/src/Dockerfile
- img : dockerhubaneo/armonik_core_bench_test_worker
path: ./Tests/Bench/Server/src/Dockerfile
- img : dockerhubaneo/armonik_core_bench_test_client
path: ./Tests/Bench/Client/src/Dockerfile
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
with:
ref: ${{ github.ref }}
submodules: true
- name: Set up QEMU
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@ecf95283f03858871ff00b787d79c419715afc34 # v2
- name: login
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2
with:
username: ${{ secrets.DOCKER_HUB_LOGIN }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Build and push
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4
with:
file: ${{ matrix.path }}
context: .
platforms: |
linux/arm64
linux/amd64
build-args: |
VERSION=${{ needs.versionning.outputs.release }}
push: true
tags: |
${{ matrix.img }}:${{ needs.versionning.outputs.release }}
publish-nuget:
runs-on: ubuntu-latest
needs:
- versionning
env:
VERSION: ${{ needs.versionning.outputs.release }}
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
with:
ref: ${{ github.ref }}
- name: Build the package
run: |
dotnet build Base/src/ArmoniK.Core.Base.csproj -c Release
- name: Pack the package
run: |
dotnet pack Base/src/ArmoniK.Core.Base.csproj -c Release -o /tmp/packages -p:PackageVersion=$VERSION -p:Version=$VERSION
- name: Push the package
run: dotnet nuget push /tmp/packages/ArmoniK.Core.*.nupkg -k ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
update-changelog:
runs-on: ubuntu-latest
needs:
- versionning
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
with:
fetch-depth: 0
- name: Set node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
node-version: 18
- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}