2022-06-19 15:16:03 +02:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
2022-08-17 23:25:52 +02:00
|
|
|
workflow_dispatch:
|
2022-06-19 15:16:03 +02:00
|
|
|
|
|
|
|
jobs:
|
2023-02-15 10:21:56 +01:00
|
|
|
release-update-repos:
|
2022-06-19 15:16:03 +02:00
|
|
|
runs-on: ubuntu-latest
|
2023-02-15 10:21:56 +01:00
|
|
|
name: Release Update Repos
|
|
|
|
|
|
|
|
steps:
|
2023-05-21 11:12:53 +02:00
|
|
|
- name: 🧰 Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
path: ImHex
|
|
|
|
|
2023-04-04 21:59:43 +02:00
|
|
|
- name: 📜 Verify version and set version variable
|
|
|
|
run: |
|
2023-11-25 15:42:51 +01:00
|
|
|
set -x
|
2023-04-04 21:59:43 +02:00
|
|
|
project_version=`cat ImHex/VERSION`
|
|
|
|
tag_version="${{github.event.release.tag_name}}"
|
|
|
|
tag_version="${tag_version:1}"
|
|
|
|
if [ "$project_version" != "$tag_version" ]; then
|
|
|
|
echo "::warning::$project_version and $tag_version are not the same ! Refusing to populate release"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "IMHEX_VERSION=$project_version" >> $GITHUB_ENV
|
|
|
|
|
2023-02-15 10:21:56 +01:00
|
|
|
- name: 🎫 Create PatternLanguage release
|
|
|
|
uses: ncipollo/release-action@v1
|
|
|
|
env:
|
|
|
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
|
|
if: "${{ env.RELEASE_TOKEN != '' }}"
|
|
|
|
with:
|
2023-04-04 21:59:43 +02:00
|
|
|
tag: ImHex-v${{ env.IMHEX_VERSION }}
|
2023-02-15 10:21:56 +01:00
|
|
|
repo: PatternLanguage
|
|
|
|
token: ${{ secrets.RELEASE_TOKEN }}
|
|
|
|
|
|
|
|
- name: 🎫 Create ImHex-Patterns release
|
|
|
|
uses: ncipollo/release-action@v1
|
|
|
|
env:
|
|
|
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
|
|
if: "${{ env.RELEASE_TOKEN != '' }}"
|
|
|
|
with:
|
2023-04-04 21:59:43 +02:00
|
|
|
tag: ImHex-v${{ env.IMHEX_VERSION }}
|
2023-02-15 10:21:56 +01:00
|
|
|
repo: ImHex-Patterns
|
|
|
|
token: ${{ secrets.RELEASE_TOKEN }}
|
|
|
|
|
|
|
|
release-upload-artifacts:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Release Upload Artifacts
|
2022-06-19 15:16:03 +02:00
|
|
|
|
2022-07-04 21:40:22 +02:00
|
|
|
steps:
|
|
|
|
- name: 🧰 Checkout
|
2022-06-19 15:16:03 +02:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
path: ImHex
|
|
|
|
submodules: recursive
|
|
|
|
|
2022-07-04 21:40:22 +02:00
|
|
|
- name: 📜 Verify version and set version variable
|
|
|
|
run: |
|
2023-11-25 15:42:51 +01:00
|
|
|
set -x
|
2022-07-04 21:40:22 +02:00
|
|
|
project_version=`cat ImHex/VERSION`
|
|
|
|
tag_version="${{github.event.release.tag_name}}"
|
|
|
|
tag_version="${tag_version:1}"
|
|
|
|
if [ "$project_version" != "$tag_version" ]; then
|
|
|
|
echo "::warning::$project_version and $tag_version are not the same ! Refusing to populate release"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-07-18 20:02:12 +02:00
|
|
|
echo "IMHEX_VERSION=$project_version" >> $GITHUB_ENV
|
2022-07-04 21:40:22 +02:00
|
|
|
|
|
|
|
- name: 🗜️ Create tarball from sources with dependencies
|
2022-07-05 10:12:16 +02:00
|
|
|
run: tar --exclude-vcs -czvf Full.Sources.tar.gz ImHex
|
2023-01-30 10:42:07 +01:00
|
|
|
|
2022-07-04 21:40:22 +02:00
|
|
|
- name: ⬇️ Download artifacts from latest workflow
|
2022-06-19 15:16:03 +02:00
|
|
|
uses: dawidd6/action-download-artifact@v2
|
|
|
|
with:
|
|
|
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
workflow: build.yml
|
2022-06-29 15:01:08 +02:00
|
|
|
branch: ${{ github.event.release.target_commitish }}
|
2022-06-19 15:16:03 +02:00
|
|
|
workflow_conclusion: success
|
|
|
|
skip_unpack: true
|
2023-01-30 10:42:07 +01:00
|
|
|
|
2022-07-04 21:40:22 +02:00
|
|
|
- name: 🗜️ Unzip files when needed
|
2023-11-25 15:42:51 +01:00
|
|
|
run: |
|
|
|
|
set -x
|
2022-06-29 15:01:08 +02:00
|
|
|
for zipfile in ./*.zip
|
|
|
|
do
|
|
|
|
if [ `zipinfo -1 "$zipfile" | wc -l` -eq 1 ];
|
|
|
|
then
|
|
|
|
echo "unzipping $zipfile"
|
|
|
|
unzip "$zipfile"
|
|
|
|
rm "$zipfile"
|
|
|
|
else
|
|
|
|
echo "keeping $zipfile zipped"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2022-09-02 16:12:02 +02:00
|
|
|
- name: 🟩 Rename artifacts when needed
|
|
|
|
run: |
|
2023-04-04 21:59:43 +02:00
|
|
|
mv "Windows Portable x86_64.zip" imhex-${{ env.IMHEX_VERSION }}-Windows-Portable-x86_64.zip
|
|
|
|
mv "Windows Portable NoGPU x86_64.zip" imhex-${{ env.IMHEX_VERSION }}-Windows-Portable-NoGPU-x86_64.zip
|
2022-06-29 15:01:08 +02:00
|
|
|
|
2022-07-04 21:40:22 +02:00
|
|
|
- name: ⬆️ Upload everything to release
|
2022-06-19 15:16:03 +02:00
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
2022-08-04 20:37:57 +02:00
|
|
|
files: '*'
|
2022-07-04 21:40:22 +02:00
|
|
|
|
|
|
|
- name: ✒️ Prepare PKGBUILD
|
|
|
|
run: |
|
2023-11-25 15:42:51 +01:00
|
|
|
set -x
|
2022-07-04 21:40:22 +02:00
|
|
|
cp ImHex/dist/Arch/PKGBUILD .
|
2023-02-13 09:05:52 +01:00
|
|
|
|
2023-04-04 21:59:43 +02:00
|
|
|
hash=`md5sum imhex-${{ env.IMHEX_VERSION }}-ArchLinux-x86_64.pkg.tar.zst | cut -d ' ' -f 1`
|
2022-07-04 21:40:22 +02:00
|
|
|
|
2023-04-04 21:59:43 +02:00
|
|
|
sed -i 's/%version%/${{ env.IMHEX_VERSION }}/g' PKGBUILD
|
2022-07-04 21:40:22 +02:00
|
|
|
sed -i "s/(SKIP)/($hash)/g" PKGBUILD
|
|
|
|
|
|
|
|
- name: ⬆️ Publish AUR package
|
2023-01-30 10:42:07 +01:00
|
|
|
|
2022-07-04 21:40:22 +02:00
|
|
|
env:
|
2022-07-18 20:02:12 +02:00
|
|
|
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
|
|
|
if: "${{ env.AUR_SSH_PRIVATE_KEY != '' }}"
|
2022-07-04 21:40:22 +02:00
|
|
|
|
|
|
|
uses: KSXGitHub/github-actions-deploy-aur@v2
|
|
|
|
with:
|
|
|
|
pkgname: imhex-bin
|
|
|
|
pkgbuild: ./PKGBUILD
|
|
|
|
commit_username: iTrooz
|
|
|
|
commit_email: itrooz@protonmail.com
|
|
|
|
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
2023-04-04 21:59:43 +02:00
|
|
|
commit_message: Bump to version ${{ env.IMHEX_VERSION }}
|
2022-07-04 21:40:22 +02:00
|
|
|
ssh_keyscan_types: rsa,dsa,ecdsa,ed25519
|
2022-07-07 16:10:21 +02:00
|
|
|
|
2023-02-15 10:21:56 +01:00
|
|
|
release-update-winget:
|
|
|
|
name: Release update winget package
|
|
|
|
needs: release-upload-artifacts
|
|
|
|
runs-on: windows-latest
|
2022-08-17 15:50:11 +02:00
|
|
|
steps:
|
|
|
|
- name: ⬇️ Download dependencies
|
|
|
|
shell: pwsh
|
|
|
|
run: |
|
2023-02-15 10:21:56 +01:00
|
|
|
iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
|
2022-08-17 15:50:11 +02:00
|
|
|
- name: ⬆️ Update winget manifest
|
|
|
|
shell: pwsh
|
|
|
|
env:
|
|
|
|
WINGET_GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
2022-09-08 09:31:49 +02:00
|
|
|
if: "${{ env.WINGET_GITHUB_TOKEN != '' }}"
|
2022-08-17 15:50:11 +02:00
|
|
|
run: |
|
2023-11-25 15:42:51 +01:00
|
|
|
set -x
|
2022-08-17 15:50:11 +02:00
|
|
|
$tagname = $env:GITHUB_REF.Replace("refs/tags/", "")
|
|
|
|
$version = $tagname.Replace("v", "")
|
2023-01-12 08:25:28 +01:00
|
|
|
$url = "https://github.com/WerWolv/ImHex/releases/download/${tagname}/imhex-${version}-Windows-x86_64.msi"
|
2022-08-17 15:50:11 +02:00
|
|
|
.\wingetcreate.exe update WerWolv.ImHex -u $url --version $version
|
|
|
|
if ($version -notmatch "-") {
|
|
|
|
.\wingetcreate.exe submit .\manifests\w\WerWolv\ImHex\${version}\ --token $env:WINGET_GITHUB_TOKEN
|
2022-08-17 22:32:55 +02:00
|
|
|
}
|