patch #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'patch' | |
concurrency: | |
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
workflow_dispatch: | |
env: | |
MODULE_NAME: CopperSpice | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Setup environment | |
shell: bash | |
run: | | |
git config --global core.autocrlf input | |
- name: Git pull | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Get top commit details | |
uses: actions/[email protected] | |
id: author-date | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const commit_details = await github.git.getCommit({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
commit_sha: context.sha | |
}); | |
return commit_details.data.author.date | |
- name: Setup environment | |
run: | | |
export COMMITTED_AT=$(date -d ${{ steps.author-date.outputs.result }} +'%Y.%m.%d_%H.%M.%S') | |
echo "COMMITTED_AT=$COMMITTED_AT" >> $GITHUB_ENV | |
echo "ARTIFACT_JAMMY_GCC_DEBUG=jammy-gcc_debug" >> $GITHUB_ENV | |
echo "ARTIFACT_JAMMY_GCC_RELEASE=jammy-gcc_release" >> $GITHUB_ENV | |
echo "ARTIFACT_WINDOWS_CL_DEBUG=windows-cl_debug" >> $GITHUB_ENV | |
echo "ARTIFACT_WINDOWS_CL_RELEASE=windows-cl_release" >> $GITHUB_ENV | |
- name: Download CopperSpice Release | |
uses: robinraju/[email protected] | |
with: | |
repository: Apotell/copperspice | |
latest: true | |
filename: '*.tar.gz' | |
out-file-path: out | |
extract: false | |
token: ${{ secrets.GHA_DAVENCHE_CI_TOKEN }} | |
- name: List directory contents | |
run: | | |
pushd out | |
ls -l | |
for artifact in "${{ env.ARTIFACT_JAMMY_GCC_DEBUG }}" "${{ env.ARTIFACT_JAMMY_GCC_RELEASE }}" "${{ env.ARTIFACT_WINDOWS_CL_DEBUG }}" "${{ env.ARTIFACT_WINDOWS_CL_RELEASE }}" | |
do | |
echo $artifact | |
tar xzfp $artifact.tar.gz | |
rm $artifact.tar.gz | |
ls -l | |
cp ../deploy/CMakeLists.txt ${{ env.MODULE_NAME }}/. | |
tar czfp $artifact.tar.gz ${{ env.MODULE_NAME }} | |
rm -rf ${{ env.MODULE_NAME }} | |
ls -l | |
done | |
ls -l | |
popd | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.COMMITTED_AT }} | |
release_name: ${{ env.MODULE_NAME }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset (jammy-gcc_debug) | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: out/${{ env.ARTIFACT_JAMMY_GCC_DEBUG }}.tar.gz | |
asset_name: ${{ env.ARTIFACT_JAMMY_GCC_DEBUG }}.tar.gz | |
asset_content_type: application/zip | |
- name: Upload Release Asset (jammy-gcc_release) | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: out/${{ env.ARTIFACT_JAMMY_GCC_RELEASE }}.tar.gz | |
asset_name: ${{ env.ARTIFACT_JAMMY_GCC_RELEASE }}.tar.gz | |
asset_content_type: application/zip | |
- name: Upload Release Asset (windows-cl_debug) | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: out/${{ env.ARTIFACT_WINDOWS_CL_DEBUG }}.tar.gz | |
asset_name: ${{ env.ARTIFACT_WINDOWS_CL_DEBUG }}.tar.gz | |
asset_content_type: application/zip | |
- name: Upload Release Asset (windows-cl_release) | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: out/${{ env.ARTIFACT_WINDOWS_CL_RELEASE }}.tar.gz | |
asset_name: ${{ env.ARTIFACT_WINDOWS_CL_RELEASE }}.tar.gz | |
asset_content_type: application/zip | |
- name: Delete some old releases | |
uses: dev-drprasad/[email protected] | |
with: | |
keep_latest: 5 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |