Skip to content

refactor: created a separate script ./scripts/_get-workflow-artefac… #144

refactor: created a separate script ./scripts/_get-workflow-artefac…

refactor: created a separate script ./scripts/_get-workflow-artefac… #144

Workflow file for this run

#
# this is the release workflow that is triggered by a push to main or develop branches
# it will
# - build the project
# - @TODO: save the artifacts to the workflow
# - @TODO: create a GitHub releases with changelog and upload the artifacts
#
name: 'release'
on:
# rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
- develop
permissions:
# write-all is too much, but we need to write to packages
# see https://github.com/orgs/community/discussions/57724 for more info
contents: read
packages: write
attestations: write
id-token: write
jobs:
build_devcontainer_image:
uses: ./.github/workflows/build-devcontainer-image.yaml
secrets: inherit
build:
runs-on: ubuntu-latest
needs:
- build_devcontainer_image
steps:
- name: checkout branch from git
uses: actions/checkout@v4
- name: display output name
run: echo "image_name=${{ needs.build_devcontainer_image.outputs.image_name }}"
- uses: './.github/shared/actions/devcontainer-shell-run'
name: build_project
with:
runCmd: |
pnpm install --frozen-lockfile
# build will already be called by the test command
# pnpm build
# # mark project already built for the next commands
# export BUILD_UP_TO_DATE=1
pnpm test
- uses: './.github/shared/actions/devcontainer-shell-run'
id: gather_workflow_artifacts
name: gather_workflow_artifacts
with:
runCmd: |
pnpm exec ./scripts/_get-workflow-artefacts.sh
- name: attach workflow artifacts
uses: actions/upload-artifact@v4
with:
# see https://github.com/actions/upload-artifact/issues/424
path: |-
${{ steps.gather_workflow_artifacts.outputs.runCmdOutput }}
# - name: print build directories
# run: |
# cat <<EOF
# stdout was=
# ${{ steps.gather_workflow_artifacts.outputs.runCmdOutput }}
# EOF