Skip to content

Commit

Permalink
add autorelease and update BOF path in extension.json
Browse files Browse the repository at this point in the history
  • Loading branch information
c2biz committed Apr 4, 2024
1 parent d002dc4 commit 9991cfc
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 1 deletion.
68 changes: 68 additions & 0 deletions .github/workflows/autorelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Release

on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
branches: ["main"]

jobs:

linux-windows-build:
name: mingw32-gcc Build
if: startsWith( github.ref, 'refs/tags/v')
runs-on: windows-2019
timeout-minutes: 45
steps:

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1

- name: Set up MinGW
uses: egor-tensin/setup-mingw@v2.2.0
with:
platform: x64
version: 12.2.0 # https://github.com/egor-tensin/setup-mingw/issues/17

- name: Check out code
uses: actions/checkout@v2

- name: Git Fetch Tags
run: git fetch --prune --unshallow --tags -f

- name: Download Tools
run: |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri https://github.com/stedolan/jq/releases/download/jq-1.6/jq-win64.exe -OutFile jq.exe
Invoke-WebRequest -Uri https://github.com/moloch--/minisign/releases/download/v0.2.1/minisign.exe -OutFile minisign.exe
- name: Compile
run: |
mkdir artifacts
make
cp .\dist\threadless-inject.o .\artifacts
cp .\LICENSE .\artifacts
- name: Build Package
# Powershell is utter fucking trash.
run: |
$Version = git.exe describe --tags --abbrev=0
Get-Content -Path extension.json | .\jq.exe --arg ver "$Version" '.version |= $ver' > .\artifacts\extension.json
cd artifacts
tar.exe -czvf ..\threadless-inject.tar.gz .
- name: Sign Package
run: |
Write-Output "${{ secrets.MINISIGN_PRIVATE_KEY }}" > minisign.key
$Content1 = Get-Content -Path ./artifacts/extension.json
$Bytes = [System.Text.Encoding]::UTF8.GetBytes($Content1)
$Encoded = [System.Convert]::ToBase64String($Bytes)
.\minisign.exe -s minisign.key -S -m threadless-inject.tar.gz -t "$Encoded" -x threadless-inject.minisig
- name: "Publish Release"
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
threadless-inject.minisig
threadless-inject.tar.gz
Binary file removed dist/threadless-inject.o
Binary file not shown.
2 changes: 1 addition & 1 deletion extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{
"os": "windows",
"arch": "amd64",
"path": "dist/threadless-inject.o"
"path": "threadless-inject.o"
}
],
"arguments": [
Expand Down

0 comments on commit 9991cfc

Please sign in to comment.