2023-07-09 23:08:24 -07:00
|
|
|
name: Android
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-android:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: ghcr.io/jandedobbeleer/golang-android-container:latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout code 👋
|
2024-05-16 17:06:41 -07:00
|
|
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
|
2023-07-09 23:08:24 -07:00
|
|
|
- name: Build
|
|
|
|
run: |
|
2023-07-14 05:21:46 -07:00
|
|
|
VERSION=$(echo "${{ github.event.release.name }}" | cut -c2-)
|
2023-07-09 23:08:24 -07:00
|
|
|
echo "Building version ${VERSION}"
|
|
|
|
cd src
|
|
|
|
go build -o dist/posh-android-arm -ldflags="-s -w -X 'github.com/jandedobbeleer/oh-my-posh/src/build.Version=${VERSION}' -X 'github.com/jandedobbeleer/oh-my-posh/src/build.Date=$(date)'"
|
|
|
|
- name: Upload artifacts 🆙
|
2023-11-19 16:14:52 -08:00
|
|
|
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
|
2023-07-09 23:08:24 -07:00
|
|
|
with:
|
|
|
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
script: |
|
|
|
|
console.log('environment', process.versions);
|
|
|
|
|
|
|
|
const fs = require('fs').promises;
|
|
|
|
|
|
|
|
const { repo: { owner, repo }, sha } = context;
|
|
|
|
console.log({ owner, repo, sha });
|
|
|
|
|
|
|
|
await github.rest.repos.uploadReleaseAsset({
|
|
|
|
owner, repo,
|
|
|
|
release_id: ${{ github.event.release.id }},
|
|
|
|
name: 'posh-android-arm',
|
|
|
|
data: await fs.readFile('./src/dist/posh-android-arm')
|
|
|
|
});
|