2019-09-19 18:28:09 +08:00
|
|
|
---
|
|
|
|
# Github Actions build for rclone
|
|
|
|
# -*- compile-command: "yamllint -f parsable build.yml" -*-
|
|
|
|
|
|
|
|
name: build
|
|
|
|
|
|
|
|
# Trigger the workflow on push or pull request
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2023-03-17 00:33:50 +08:00
|
|
|
- '**'
|
2019-09-19 18:28:09 +08:00
|
|
|
tags:
|
2023-03-17 00:33:50 +08:00
|
|
|
- '**'
|
2019-09-19 18:28:09 +08:00
|
|
|
pull_request:
|
2021-04-27 00:52:03 +08:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
manual:
|
2023-01-22 07:54:02 +08:00
|
|
|
description: Manual run (bypass default conditions)
|
|
|
|
type: boolean
|
2021-04-27 00:52:03 +08:00
|
|
|
default: true
|
2019-09-19 18:28:09 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2024-10-03 02:37:11 +08:00
|
|
|
if: inputs.manual || (github.repository == 'rclone/rclone' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name))
|
2019-09-19 18:28:09 +08:00
|
|
|
timeout-minutes: 60
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2024-07-18 23:57:24 +08:00
|
|
|
job_name: ['linux', 'linux_386', 'mac_amd64', 'mac_arm64', 'windows', 'other_os', 'go1.21', 'go1.22']
|
2019-09-19 18:28:09 +08:00
|
|
|
|
|
|
|
include:
|
|
|
|
- job_name: linux
|
|
|
|
os: ubuntu-latest
|
2024-07-18 23:57:24 +08:00
|
|
|
go: '>=1.23.0-rc.1'
|
2019-09-19 18:28:09 +08:00
|
|
|
gotags: cmount
|
|
|
|
build_flags: '-include "^linux/"'
|
|
|
|
check: true
|
|
|
|
quicktest: true
|
2020-07-24 18:44:51 +08:00
|
|
|
racequicktest: true
|
2021-03-30 18:37:59 +08:00
|
|
|
librclonetest: true
|
2019-09-19 18:28:09 +08:00
|
|
|
deploy: true
|
|
|
|
|
2022-07-13 22:59:24 +08:00
|
|
|
- job_name: linux_386
|
|
|
|
os: ubuntu-latest
|
2024-07-18 23:57:24 +08:00
|
|
|
go: '>=1.23.0-rc.1'
|
2022-07-13 22:59:24 +08:00
|
|
|
goarch: 386
|
|
|
|
gotags: cmount
|
|
|
|
quicktest: true
|
|
|
|
|
2021-02-05 18:20:19 +08:00
|
|
|
- job_name: mac_amd64
|
2024-04-05 06:30:46 +08:00
|
|
|
os: macos-latest
|
2024-07-18 23:57:24 +08:00
|
|
|
go: '>=1.23.0-rc.1'
|
2020-07-04 04:36:21 +08:00
|
|
|
gotags: 'cmount'
|
2019-09-19 18:28:09 +08:00
|
|
|
build_flags: '-include "^darwin/amd64" -cgo'
|
|
|
|
quicktest: true
|
|
|
|
racequicktest: true
|
|
|
|
deploy: true
|
|
|
|
|
2021-02-05 18:20:19 +08:00
|
|
|
- job_name: mac_arm64
|
2024-04-05 06:30:46 +08:00
|
|
|
os: macos-latest
|
2024-07-18 23:57:24 +08:00
|
|
|
go: '>=1.23.0-rc.1'
|
2021-02-05 18:20:19 +08:00
|
|
|
gotags: 'cmount'
|
2022-01-27 01:55:38 +08:00
|
|
|
build_flags: '-include "^darwin/arm64" -cgo -macos-arch arm64 -cgo-cflags=-I/usr/local/include -cgo-ldflags=-L/usr/local/lib'
|
2021-02-05 18:20:19 +08:00
|
|
|
deploy: true
|
|
|
|
|
2022-04-23 00:46:12 +08:00
|
|
|
- job_name: windows
|
2019-09-19 18:28:09 +08:00
|
|
|
os: windows-latest
|
2024-07-18 23:57:24 +08:00
|
|
|
go: '>=1.23.0-rc.1'
|
2019-09-19 18:28:09 +08:00
|
|
|
gotags: cmount
|
2022-04-23 00:46:12 +08:00
|
|
|
cgo: '0'
|
|
|
|
build_flags: '-include "^windows/"'
|
2020-11-30 00:52:10 +08:00
|
|
|
build_args: '-buildmode exe'
|
2019-09-19 18:28:09 +08:00
|
|
|
quicktest: true
|
|
|
|
deploy: true
|
|
|
|
|
|
|
|
- job_name: other_os
|
|
|
|
os: ubuntu-latest
|
2024-07-18 23:57:24 +08:00
|
|
|
go: '>=1.23.0-rc.1'
|
2022-04-23 00:46:12 +08:00
|
|
|
build_flags: '-exclude "^(windows/|darwin/|linux/)"'
|
2019-09-19 18:28:09 +08:00
|
|
|
compile_all: true
|
|
|
|
deploy: true
|
|
|
|
|
2024-07-18 23:57:24 +08:00
|
|
|
- job_name: go1.21
|
2021-01-08 20:22:37 +08:00
|
|
|
os: ubuntu-latest
|
2024-07-18 23:57:24 +08:00
|
|
|
go: '1.21'
|
2021-01-08 20:22:37 +08:00
|
|
|
quicktest: true
|
|
|
|
racequicktest: true
|
|
|
|
|
2024-07-18 23:57:24 +08:00
|
|
|
- job_name: go1.22
|
2021-08-15 23:42:51 +08:00
|
|
|
os: ubuntu-latest
|
2024-07-18 23:57:24 +08:00
|
|
|
go: '1.22'
|
2021-08-15 23:42:51 +08:00
|
|
|
quicktest: true
|
|
|
|
racequicktest: true
|
|
|
|
|
2019-09-19 18:28:09 +08:00
|
|
|
name: ${{ matrix.job_name }}
|
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-05 06:14:49 +08:00
|
|
|
uses: actions/checkout@v4
|
2019-09-19 18:28:09 +08:00
|
|
|
with:
|
2020-07-24 18:44:51 +08:00
|
|
|
fetch-depth: 0
|
2019-09-19 18:28:09 +08:00
|
|
|
|
|
|
|
- name: Install Go
|
2023-12-07 06:48:34 +08:00
|
|
|
uses: actions/setup-go@v5
|
2019-09-19 18:28:09 +08:00
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go }}
|
2022-03-18 01:14:50 +08:00
|
|
|
check-latest: true
|
2019-09-19 18:28:09 +08:00
|
|
|
|
|
|
|
- name: Set environment variables
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2020-10-26 19:19:06 +08:00
|
|
|
echo 'GOTAGS=${{ matrix.gotags }}' >> $GITHUB_ENV
|
|
|
|
echo 'BUILD_FLAGS=${{ matrix.build_flags }}' >> $GITHUB_ENV
|
2020-11-30 00:52:10 +08:00
|
|
|
echo 'BUILD_ARGS=${{ matrix.build_args }}' >> $GITHUB_ENV
|
2020-10-26 19:19:06 +08:00
|
|
|
if [[ "${{ matrix.goarch }}" != "" ]]; then echo 'GOARCH=${{ matrix.goarch }}' >> $GITHUB_ENV ; fi
|
|
|
|
if [[ "${{ matrix.cgo }}" != "" ]]; then echo 'CGO_ENABLED=${{ matrix.cgo }}' >> $GITHUB_ENV ; fi
|
2019-09-19 18:28:09 +08:00
|
|
|
|
|
|
|
- name: Install Libraries on Linux
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
sudo modprobe fuse
|
|
|
|
sudo chmod 666 /dev/fuse
|
|
|
|
sudo chown root:$USER /etc/fuse.conf
|
2024-06-26 00:14:26 +08:00
|
|
|
sudo apt-get install fuse3 libfuse-dev rpm pkg-config git-annex git-annex-remote-rclone nfs-common
|
2019-09-19 18:28:09 +08:00
|
|
|
if: matrix.os == 'ubuntu-latest'
|
|
|
|
|
|
|
|
- name: Install Libraries on macOS
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2023-06-23 16:50:01 +08:00
|
|
|
# https://github.com/Homebrew/brew/issues/15621#issuecomment-1619266788
|
|
|
|
# https://github.com/orgs/Homebrew/discussions/4612#discussioncomment-6319008
|
|
|
|
unset HOMEBREW_NO_INSTALL_FROM_API
|
|
|
|
brew untap --force homebrew/core
|
|
|
|
brew untap --force homebrew/cask
|
2019-09-19 18:28:09 +08:00
|
|
|
brew update
|
2021-02-06 00:07:59 +08:00
|
|
|
brew install --cask macfuse
|
2024-04-16 04:44:30 +08:00
|
|
|
brew install git-annex git-annex-remote-rclone
|
2024-04-05 06:30:46 +08:00
|
|
|
if: matrix.os == 'macos-latest'
|
2019-09-19 18:28:09 +08:00
|
|
|
|
|
|
|
- name: Install Libraries on Windows
|
|
|
|
shell: powershell
|
|
|
|
run: |
|
|
|
|
$ProgressPreference = 'SilentlyContinue'
|
|
|
|
choco install -y winfsp zip
|
2020-10-26 19:19:06 +08:00
|
|
|
echo "CPATH=C:\Program Files\WinFsp\inc\fuse;C:\Program Files (x86)\WinFsp\inc\fuse" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
2019-09-19 18:28:09 +08:00
|
|
|
if ($env:GOARCH -eq "386") {
|
|
|
|
choco install -y mingw --forcex86 --force
|
2020-10-26 19:19:06 +08:00
|
|
|
echo "C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw32\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
2019-09-19 18:28:09 +08:00
|
|
|
}
|
|
|
|
# Copy mingw32-make.exe to make.exe so the same command line
|
|
|
|
# can be used on Windows as on macOS and Linux
|
|
|
|
$path = (get-command mingw32-make.exe).Path
|
|
|
|
Copy-Item -Path $path -Destination (Join-Path (Split-Path -Path $path) 'make.exe')
|
|
|
|
if: matrix.os == 'windows-latest'
|
|
|
|
|
|
|
|
- name: Print Go version and environment
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
printf "Using go at: $(which go)\n"
|
|
|
|
printf "Go version: $(go version)\n"
|
|
|
|
printf "\n\nGo environment:\n\n"
|
|
|
|
go env
|
|
|
|
printf "\n\nRclone environment:\n\n"
|
|
|
|
make vars
|
|
|
|
printf "\n\nSystem environment:\n\n"
|
|
|
|
env
|
|
|
|
|
2020-07-24 18:44:51 +08:00
|
|
|
- name: Build rclone
|
2019-09-19 18:28:09 +08:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
make
|
2020-07-24 18:44:51 +08:00
|
|
|
|
2022-04-24 17:37:46 +08:00
|
|
|
- name: Rclone version
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
rclone version
|
|
|
|
|
2020-07-24 18:44:51 +08:00
|
|
|
- name: Run tests
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2019-09-19 18:28:09 +08:00
|
|
|
make quicktest
|
|
|
|
if: matrix.quicktest
|
|
|
|
|
|
|
|
- name: Race test
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
make racequicktest
|
|
|
|
if: matrix.racequicktest
|
|
|
|
|
2021-03-30 18:37:59 +08:00
|
|
|
- name: Run librclone tests
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
make -C librclone/ctest test
|
|
|
|
make -C librclone/ctest clean
|
2021-04-28 23:53:35 +08:00
|
|
|
librclone/python/test_rclone.py
|
2021-03-30 18:37:59 +08:00
|
|
|
if: matrix.librclonetest
|
|
|
|
|
2019-09-19 18:28:09 +08:00
|
|
|
- name: Compile all architectures test
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
make
|
|
|
|
make compile_all
|
|
|
|
if: matrix.compile_all
|
|
|
|
|
|
|
|
- name: Deploy built binaries
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2020-06-16 01:27:20 +08:00
|
|
|
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then make release_dep_linux ; fi
|
|
|
|
make ci_beta
|
2019-09-19 18:28:09 +08:00
|
|
|
env:
|
|
|
|
RCLONE_CONFIG_PASS: ${{ secrets.RCLONE_CONFIG_PASS }}
|
|
|
|
# working-directory: '$(modulePath)'
|
2020-01-09 01:27:44 +08:00
|
|
|
# Deploy binaries if enabled in config && not a PR && not a fork
|
2023-03-17 20:11:41 +08:00
|
|
|
if: env.RCLONE_CONFIG_PASS != '' && matrix.deploy && github.head_ref == '' && github.repository == 'rclone/rclone'
|
2019-09-25 22:36:19 +08:00
|
|
|
|
2021-10-15 00:23:19 +08:00
|
|
|
lint:
|
2024-10-03 02:37:11 +08:00
|
|
|
if: inputs.manual || (github.repository == 'rclone/rclone' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name))
|
2021-10-15 00:23:19 +08:00
|
|
|
timeout-minutes: 30
|
|
|
|
name: "lint"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2024-04-25 14:00:27 +08:00
|
|
|
- name: Get runner parameters
|
|
|
|
id: get-runner-parameters
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "year-week=$(/bin/date -u "+%Y%V")" >> $GITHUB_OUTPUT
|
|
|
|
echo "runner-os-version=$ImageOS" >> $GITHUB_OUTPUT
|
|
|
|
|
2021-10-15 00:23:19 +08:00
|
|
|
- name: Checkout
|
2023-09-05 06:14:49 +08:00
|
|
|
uses: actions/checkout@v4
|
2021-10-15 00:23:19 +08:00
|
|
|
|
2022-10-23 20:27:56 +08:00
|
|
|
- name: Install Go
|
2024-04-25 14:00:27 +08:00
|
|
|
id: setup-go
|
2023-12-07 06:48:34 +08:00
|
|
|
uses: actions/setup-go@v5
|
2022-10-23 20:27:56 +08:00
|
|
|
with:
|
2024-08-15 01:26:25 +08:00
|
|
|
go-version: '>=1.23.0-rc.1'
|
2022-10-23 20:27:56 +08:00
|
|
|
check-latest: true
|
2024-04-18 15:42:16 +08:00
|
|
|
cache: false
|
|
|
|
|
2024-04-25 14:00:27 +08:00
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/go/pkg/mod
|
|
|
|
~/.cache/go-build
|
|
|
|
~/.cache/golangci-lint
|
|
|
|
key: golangci-lint-${{ steps.get-runner-parameters.outputs.runner-os-version }}-go${{ steps.setup-go.outputs.go-version }}-${{ steps.get-runner-parameters.outputs.year-week }}-${{ hashFiles('go.sum') }}
|
|
|
|
restore-keys: golangci-lint-${{ steps.get-runner-parameters.outputs.runner-os-version }}-go${{ steps.setup-go.outputs.go-version }}-${{ steps.get-runner-parameters.outputs.year-week }}-
|
|
|
|
|
2024-04-18 15:42:16 +08:00
|
|
|
- name: Code quality test (Linux)
|
2024-04-25 14:00:27 +08:00
|
|
|
uses: golangci/golangci-lint-action@v6
|
2024-04-18 15:42:16 +08:00
|
|
|
with:
|
|
|
|
version: latest
|
2024-04-25 14:00:27 +08:00
|
|
|
skip-cache: true
|
2024-04-18 15:42:16 +08:00
|
|
|
|
|
|
|
- name: Code quality test (Windows)
|
2024-04-25 14:00:27 +08:00
|
|
|
uses: golangci/golangci-lint-action@v6
|
2024-04-18 15:42:16 +08:00
|
|
|
env:
|
|
|
|
GOOS: "windows"
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
skip-cache: true
|
|
|
|
|
|
|
|
- name: Code quality test (macOS)
|
2024-04-25 14:00:27 +08:00
|
|
|
uses: golangci/golangci-lint-action@v6
|
2024-04-18 15:42:16 +08:00
|
|
|
env:
|
|
|
|
GOOS: "darwin"
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
skip-cache: true
|
|
|
|
|
|
|
|
- name: Code quality test (FreeBSD)
|
2024-04-25 14:00:27 +08:00
|
|
|
uses: golangci/golangci-lint-action@v6
|
2024-04-18 15:42:16 +08:00
|
|
|
env:
|
|
|
|
GOOS: "freebsd"
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
skip-cache: true
|
|
|
|
|
|
|
|
- name: Code quality test (OpenBSD)
|
2024-04-25 14:00:27 +08:00
|
|
|
uses: golangci/golangci-lint-action@v6
|
2024-04-18 15:42:16 +08:00
|
|
|
env:
|
|
|
|
GOOS: "openbsd"
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
skip-cache: true
|
2022-10-23 20:27:56 +08:00
|
|
|
|
|
|
|
- name: Install govulncheck
|
|
|
|
run: go install golang.org/x/vuln/cmd/govulncheck@latest
|
|
|
|
|
|
|
|
- name: Scan for vulnerabilities
|
|
|
|
run: govulncheck ./...
|
|
|
|
|
2021-03-18 01:00:16 +08:00
|
|
|
android:
|
2024-10-03 02:37:11 +08:00
|
|
|
if: inputs.manual || (github.repository == 'rclone/rclone' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name))
|
2021-10-15 19:35:21 +08:00
|
|
|
timeout-minutes: 30
|
|
|
|
name: "android-all"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-09-05 06:14:49 +08:00
|
|
|
uses: actions/checkout@v4
|
2021-10-15 19:35:21 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
# Upgrade together with NDK version
|
2022-04-02 01:30:42 +08:00
|
|
|
- name: Set up Go
|
2023-12-07 06:48:34 +08:00
|
|
|
uses: actions/setup-go@v5
|
2021-10-15 19:35:21 +08:00
|
|
|
with:
|
2024-07-18 23:57:24 +08:00
|
|
|
go-version: '>=1.23.0-rc.1'
|
2021-10-15 19:35:21 +08:00
|
|
|
|
|
|
|
- name: Set global environment variables
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "VERSION=$(make version)" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: build native rclone
|
|
|
|
run: |
|
|
|
|
make
|
|
|
|
|
|
|
|
- name: install gomobile
|
|
|
|
run: |
|
2022-04-02 01:30:42 +08:00
|
|
|
go install golang.org/x/mobile/cmd/gobind@latest
|
|
|
|
go install golang.org/x/mobile/cmd/gomobile@latest
|
2021-10-15 19:35:21 +08:00
|
|
|
env PATH=$PATH:~/go/bin gomobile init
|
2022-08-03 22:03:15 +08:00
|
|
|
echo "RCLONE_NDK_VERSION=21" >> $GITHUB_ENV
|
2021-10-15 19:35:21 +08:00
|
|
|
|
|
|
|
- name: arm-v7a gomobile build
|
2022-08-03 22:03:15 +08:00
|
|
|
run: env PATH=$PATH:~/go/bin gomobile bind -androidapi ${RCLONE_NDK_VERSION} -v -target=android/arm -javapkg=org.rclone -ldflags '-s -X github.com/rclone/rclone/fs.Version='${VERSION} github.com/rclone/rclone/librclone/gomobile
|
2021-10-15 19:35:21 +08:00
|
|
|
|
|
|
|
- name: arm-v7a Set environment variables
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-08-03 22:03:15 +08:00
|
|
|
echo "CC=$(echo $ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi${RCLONE_NDK_VERSION}-clang)" >> $GITHUB_ENV
|
2021-10-15 19:35:21 +08:00
|
|
|
echo "CC_FOR_TARGET=$CC" >> $GITHUB_ENV
|
|
|
|
echo 'GOOS=android' >> $GITHUB_ENV
|
|
|
|
echo 'GOARCH=arm' >> $GITHUB_ENV
|
|
|
|
echo 'GOARM=7' >> $GITHUB_ENV
|
|
|
|
echo 'CGO_ENABLED=1' >> $GITHUB_ENV
|
|
|
|
echo 'CGO_LDFLAGS=-fuse-ld=lld -s -w' >> $GITHUB_ENV
|
2022-08-03 22:03:15 +08:00
|
|
|
|
2021-10-15 19:35:21 +08:00
|
|
|
- name: arm-v7a build
|
2022-08-03 22:03:15 +08:00
|
|
|
run: go build -v -tags android -trimpath -ldflags '-s -X github.com/rclone/rclone/fs.Version='${VERSION} -o build/rclone-android-${RCLONE_NDK_VERSION}-armv7a .
|
2021-10-15 19:35:21 +08:00
|
|
|
|
|
|
|
- name: arm64-v8a Set environment variables
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-08-03 22:03:15 +08:00
|
|
|
echo "CC=$(echo $ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android${RCLONE_NDK_VERSION}-clang)" >> $GITHUB_ENV
|
2021-10-15 19:35:21 +08:00
|
|
|
echo "CC_FOR_TARGET=$CC" >> $GITHUB_ENV
|
|
|
|
echo 'GOOS=android' >> $GITHUB_ENV
|
|
|
|
echo 'GOARCH=arm64' >> $GITHUB_ENV
|
|
|
|
echo 'CGO_ENABLED=1' >> $GITHUB_ENV
|
|
|
|
echo 'CGO_LDFLAGS=-fuse-ld=lld -s -w' >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: arm64-v8a build
|
2022-08-03 22:03:15 +08:00
|
|
|
run: go build -v -tags android -trimpath -ldflags '-s -X github.com/rclone/rclone/fs.Version='${VERSION} -o build/rclone-android-${RCLONE_NDK_VERSION}-armv8a .
|
2021-10-15 19:35:21 +08:00
|
|
|
|
|
|
|
- name: x86 Set environment variables
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-08-03 22:03:15 +08:00
|
|
|
echo "CC=$(echo $ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android${RCLONE_NDK_VERSION}-clang)" >> $GITHUB_ENV
|
2021-10-15 19:35:21 +08:00
|
|
|
echo "CC_FOR_TARGET=$CC" >> $GITHUB_ENV
|
|
|
|
echo 'GOOS=android' >> $GITHUB_ENV
|
|
|
|
echo 'GOARCH=386' >> $GITHUB_ENV
|
|
|
|
echo 'CGO_ENABLED=1' >> $GITHUB_ENV
|
|
|
|
echo 'CGO_LDFLAGS=-fuse-ld=lld -s -w' >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: x86 build
|
2022-08-03 22:03:15 +08:00
|
|
|
run: go build -v -tags android -trimpath -ldflags '-s -X github.com/rclone/rclone/fs.Version='${VERSION} -o build/rclone-android-${RCLONE_NDK_VERSION}-x86 .
|
2021-10-15 19:35:21 +08:00
|
|
|
|
|
|
|
- name: x64 Set environment variables
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-08-03 22:03:15 +08:00
|
|
|
echo "CC=$(echo $ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android${RCLONE_NDK_VERSION}-clang)" >> $GITHUB_ENV
|
2021-10-15 19:35:21 +08:00
|
|
|
echo "CC_FOR_TARGET=$CC" >> $GITHUB_ENV
|
|
|
|
echo 'GOOS=android' >> $GITHUB_ENV
|
|
|
|
echo 'GOARCH=amd64' >> $GITHUB_ENV
|
|
|
|
echo 'CGO_ENABLED=1' >> $GITHUB_ENV
|
|
|
|
echo 'CGO_LDFLAGS=-fuse-ld=lld -s -w' >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: x64 build
|
2022-08-03 22:03:15 +08:00
|
|
|
run: go build -v -tags android -trimpath -ldflags '-s -X github.com/rclone/rclone/fs.Version='${VERSION} -o build/rclone-android-${RCLONE_NDK_VERSION}-x64 .
|
2021-10-15 19:35:21 +08:00
|
|
|
|
|
|
|
- name: Upload artifacts
|
|
|
|
run: |
|
|
|
|
make ci_upload
|
|
|
|
env:
|
|
|
|
RCLONE_CONFIG_PASS: ${{ secrets.RCLONE_CONFIG_PASS }}
|
|
|
|
# Upload artifacts if not a PR && not a fork
|
2023-03-17 20:11:41 +08:00
|
|
|
if: env.RCLONE_CONFIG_PASS != '' && github.head_ref == '' && github.repository == 'rclone/rclone'
|