-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
121 changed files
with
4,652 additions
and
2,337 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,108 +29,35 @@ env: | |
GOPRIVATE: github.com/getlantern | ||
S3_BUCKET: lantern | ||
jobs: | ||
build-desktop: | ||
build-windows: | ||
permissions: | ||
contents: "read" | ||
id-token: "write" | ||
env: | ||
version: ${{ inputs.version }} | ||
prefix: ${{ inputs.prefix }} | ||
runs-on: ubuntu-20.04 | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
lfs: true | ||
|
||
- name: Pull LFS objects | ||
run: git lfs pull | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: "go.mod" | ||
|
||
- name: Granting private modules access | ||
run: | | ||
git config --global url."https://${{ secrets.GH_TOKEN }}:[email protected]/".insteadOf "https://github.com/" | ||
- name: Repo access | ||
run: | | ||
mkdir /tmp/cache | ||
echo "machine github.com login ${{ secrets.GH_TOKEN }} password x-oauth-basic" > /tmp/cache/.netrc | ||
chmod 600 /tmp/cache/.netrc | ||
- name: Setup Sentry CLI | ||
uses: mathieu-bour/setup-sentry-cli@v2 | ||
with: | ||
version: latest | ||
token: ${{ SECRETS.SENTRY_TOKEN }} # from GitHub secrets | ||
organization: getlantern | ||
project: android | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get install -y file build-essential pkg-config | ||
sudo apt-get install -y mingw-w64 nsis | ||
- name: Build liblantern.dll | ||
if: ${{inputs.update-suffix == '386'}} | ||
run: | | ||
make windows | ||
- name: Build liblantern.dll | ||
if: ${{inputs.update-suffix == 'x64'}} | ||
env: | ||
SENTRY_AUTH_TOKEN: "${{ secrets.SENTRY_AUTH_TOKEN }}" | ||
VERSION: "${{ env.version }}" | ||
run: | | ||
make windows64 | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: libgo-windows-${{inputs.update-suffix}}-build | ||
if-no-files-found: error | ||
path: | | ||
liblantern.dll | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: libgo-windows-${{inputs.update-suffix}}-header | ||
if-no-files-found: error | ||
path: | | ||
liblantern.h | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Install s3cmd | ||
run: pip install s3cmd | ||
|
||
- name: Set s3cmd permissions | ||
- name: Install WebView2 Runtime | ||
shell: pwsh | ||
run: | | ||
echo "[default]" > "$HOME/.s3cfg" | ||
echo "access_key = ${{ secrets.AWS_ACCESS_KEY }}" >> "$HOME/.s3cfg" | ||
echo "secret_key = ${{ secrets.AWS_SECRET_KEY }}" >> "$HOME/.s3cfg" | ||
Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/p/?LinkId=2124703" -OutFile "MicrosoftEdgeWebView2Setup.exe" | ||
Start-Process -FilePath ".\MicrosoftEdgeWebView2Setup.exe" -ArgumentList "/silent", "/install" -Wait | ||
- name: Push libgo to S3 | ||
run: s3cmd put --acl-public liblantern.dll "s3://lantern/liblantern-${{inputs.update-suffix}}.dll" | ||
- name: Set up MinGW | ||
run: choco install mingw -y | ||
|
||
build-windows: | ||
needs: build-desktop | ||
permissions: | ||
contents: "read" | ||
id-token: "write" | ||
env: | ||
version: ${{ inputs.version }} | ||
prefix: ${{ inputs.prefix }} | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
lfs: true | ||
# Install Flutter | ||
- uses: subosito/flutter-action@v2 | ||
- name: Install Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: "stable" | ||
|
||
|
@@ -141,26 +68,18 @@ jobs: | |
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Activate protoc-gen-dart plugin | ||
run: | | ||
dart pub global activate protoc_plugin | ||
- name: Download the win build output | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: libgo-windows-${{inputs.update-suffix}}-build | ||
|
||
- name: Download the win build output | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: libgo-windows-${{inputs.update-suffix}}-header | ||
|
||
- run: make ffigen | ||
|
||
- run: touch app.env | ||
- name: Build Lantern Library | ||
shell: bash | ||
run: | | ||
touch app.env | ||
mkdir -p "build/windows/${{inputs.arch}}/runner/Release" | ||
make windows64 | ||
- name: Build Flutter app | ||
run: flutter build windows | ||
- name: Activate plugins | ||
run: | | ||
dart pub global activate protoc_plugin | ||
dart pub global activate flutter_distributor | ||
- name: Sign liblantern.dll with Azure Code Signing | ||
uses: getlantern/trusted-signing-action@main | ||
|
@@ -177,74 +96,30 @@ jobs: | |
timestamp-rfc3161: http://timestamp.acs.microsoft.com | ||
timestamp-digest: SHA256 | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
if-no-files-found: error | ||
name: windows${{inputs.build-suffix}}-build-signed | ||
path: | | ||
liblantern.dll | ||
- name: Create archive | ||
- name: Move liblantern.dll to release directory | ||
shell: bash | ||
run: | | ||
ls build/windows | ||
cp liblantern.dll "build/windows/${{inputs.arch}}/runner/Release" | ||
Compress-Archive "build/windows/${{inputs.arch}}/runner/Release" lantern.zip | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
if-no-files-found: error | ||
name: windows${{inputs.build-suffix}}-build | ||
path: lantern.zip | ||
|
||
build-installer: | ||
needs: build-windows | ||
permissions: | ||
contents: "read" | ||
id-token: "write" | ||
env: | ||
version: ${{ inputs.version }} | ||
prefix: ${{ inputs.prefix }} | ||
runs-on: ubuntu-20.04 | ||
mv liblantern.dll "build/windows/${{inputs.arch}}/runner/Release" | ||
steps: | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get install -y file build-essential pkg-config | ||
sudo apt-get install -y mingw-w64 nsis | ||
- uses: actions/checkout@v4 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: windows${{inputs.build-suffix}}-build | ||
- name: Make installer | ||
- name: Extract app version from pubspec.yaml | ||
id: extract_version | ||
shell: bash | ||
run: | | ||
pwd | ||
unzip lantern.zip | ||
cp installer-resources-lantern/.packaged-lantern.yaml installer-resources-lantern/windows/.packaged-lantern.yaml | ||
cp installer-resources-lantern/lantern.yaml installer-resources-lantern/windows/lantern.yaml | ||
cp -r Release/* installer-resources-lantern/windows | ||
makensis -V1 -DVERSION=${{ inputs.version }} -DAPP_NAME=lantern.exe -DOUT_FILE="lantern-installer${{inputs.installer-suffix}}.exe" installer-resources-lantern/windows/lantern.nsi | ||
mv installer-resources-lantern/windows/lantern-installer${{inputs.installer-suffix}}.exe lantern-installer${{inputs.installer-suffix}}.exe | ||
APP_VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //') | ||
echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
if-no-files-found: error | ||
name: windows${{inputs.build-suffix}}-installer-unsigned | ||
path: lantern-installer${{inputs.installer-suffix}}.exe | ||
- name: Build Flutter app | ||
run: | | ||
New-Item -Path "./dist/${{ env.APP_VERSION }}" -ItemType Directory -Force | ||
flutter_distributor package --platform windows --targets exe --skip-clean | ||
env: | ||
SENTRY_AUTH_TOKEN: "${{ secrets.SENTRY_AUTH_TOKEN }}" | ||
VERSION: "${{ env.version }}" | ||
|
||
sign-installer: | ||
needs: build-installer | ||
permissions: | ||
contents: "read" | ||
id-token: "write" | ||
env: | ||
version: ${{ inputs.version }} | ||
prefix: ${{ inputs.prefix }} | ||
runs-on: windows-latest | ||
steps: | ||
- name: Download the win build output | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: windows${{inputs.build-suffix}}-installer-unsigned | ||
- name: Rename installer | ||
shell: bash | ||
run: | | ||
mv "dist/${{ env.APP_VERSION }}/lantern-${{ env.APP_VERSION }}-windows-setup.exe" lantern-installer${{inputs.installer-suffix}}.exe | ||
- name: Sign EXE with Azure Code Signing | ||
uses: getlantern/trusted-signing-action@main | ||
|
@@ -255,27 +130,28 @@ jobs: | |
endpoint: https://wus2.codesigning.azure.net/ | ||
code-signing-account-name: code-signing | ||
certificate-profile-name: Lantern | ||
files-folder: ${{ github.workspace }}\ | ||
files-folder-filter: exe | ||
files-folder: ${{ github.workspace }}/ | ||
files-folder-filter: exe,dll,msix | ||
file-digest: SHA256 | ||
timestamp-rfc3161: http://timestamp.acs.microsoft.com | ||
timestamp-digest: SHA256 | ||
|
||
- uses: actions/upload-artifact@v4 | ||
- name: Upload EXE artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: windows${{inputs.build-suffix}}-installer-signed | ||
path: | | ||
lantern-installer${{inputs.installer-suffix}}.exe | ||
upload-windows: | ||
needs: sign-installer | ||
needs: build-windows | ||
permissions: | ||
contents: "read" | ||
id-token: "write" | ||
env: | ||
version: ${{ inputs.version }} | ||
prefix: ${{ inputs.prefix }} | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Download the artifact | ||
|
Oops, something went wrong.