Skip to content
Snippets Groups Projects

:rocket: RELEASE: Bump to 0.2.1

Merged Samuel Guillemet requested to merge develop into main
17 files
+ 572
502
Compare changes
  • Side-by-side
  • Inline
Files
17
+ 34
15
@@ -11,27 +11,45 @@ env:
HARBOR_REGISTRY: registry.cern.ch
jobs:
get-tag-name:
get-version:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
outputs:
tag_name: ${{ steps.release-on-push.outputs.tag_name }}
tag_name: ${{ steps.get-tag-name.outputs.tag_name }}
steps:
- name: Get the tag name generated by the release-on-push workflow
id: release-on-push
uses: actions/github-script@v4
- name: Download artifact
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const last_release = await github.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo,
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
const last_release_tag = last_release.data.tag_name;
core.setOutput("tag_name", last_release_tag);
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "version_number"
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/version_number.zip`, Buffer.from(download.data));
- name: Unzip artifact
run: unzip version_number.zip
- name: Get tag name
id: get-tag-name
run: |
echo "tag_name=$(cat version_number)" >> $GITHUB_OUTPUT
build-and-push-to-github:
runs-on: ubuntu-latest
needs: get-tag-name
needs: get-version
if: needs.get-version.outputs.tag_name != ''
steps:
- name: Checkout repository
uses: actions/checkout@v3
@@ -47,13 +65,14 @@ jobs:
run: |
docker compose -f docker-compose.yml -f docker-compose.github.yml build
docker compose -f docker-compose.yml -f docker-compose.github.yml push
export tag=${{ needs.get-tag-name.outputs.tag_name }}
export tag=${{ needs.get-version.outputs.tag_name }}
docker compose -f docker-compose.yml -f docker-compose.github.yml build
docker compose -f docker-compose.yml -f docker-compose.github.yml push
build-and-push-to-harbor:
runs-on: ubuntu-latest
needs: get-tag-name
needs: get-version
if: needs.get-version.outputs.tag_name != ''
steps:
- name: Checkout repository
uses: actions/checkout@v3
@@ -69,6 +88,6 @@ jobs:
run: |
docker compose -f docker-compose.yml -f docker-compose.harbor.yml build
docker compose -f docker-compose.yml -f docker-compose.harbor.yml push
export tag=${{ needs.get-tag-name.outputs.tag_name }}
export tag=${{ needs.get-version.outputs.tag_name }}
docker compose -f docker-compose.yml -f docker-compose.harbor.yml build
docker compose -f docker-compose.yml -f docker-compose.harbor.yml push
Loading