Skip to content

Commit 52441ce

Browse files
committed
Converted travis ci yml to github action
1 parent a8b705e commit 52441ce

File tree

2 files changed

+71
-3
lines changed

2 files changed

+71
-3
lines changed

.github/workflows/macos-build.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Build macOS Binaries
2+
3+
on:
4+
push:
5+
branches:
6+
- development
7+
pull_request:
8+
branches:
9+
- development
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
runs-on: macos-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v2
19+
20+
- name: Set up Xcode
21+
uses: maxim-lobanov/setup-xcode@v1
22+
with:
23+
xcode-version: latest-stable
24+
25+
- name: Install dependencies
26+
run: |
27+
export PIP_BREAK_SYSTEM_PACKAGES=1
28+
brew install conan p7zip
29+
pip3 install requests
30+
31+
- name: Build macOS binary
32+
run: |
33+
make arcmac
34+
35+
- name: Download filehost-upload script
36+
run: |
37+
wget https://raw.githubusercontent.com/MEGA65/builder-docker/main/megabuild/filehost-upload
38+
39+
- name: Publish artifacts
40+
if: github.event_name != 'pull_request'
41+
env:
42+
FH_API_KEY: ${{ secrets.FH_API_KEY }}
43+
run: |
44+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
45+
python3 filehost-upload -i 7d96641c-b306-49cf-80ff-ea1e5d00c9d1 -a addversion -V ${{ github.run_number }} -I "`git log -1 --pretty=tformat:'dev@%h: %s'`" m65tools-*-macos.7z
46+
elif [[ "${{ github.ref }}" == "refs/heads/development" ]]; then
47+
python3 filehost-upload -i 0dee985e-5bc1-404b-adb0-fc7989aef346 -a addversion -V ${{ github.run_number }} -I "`git log -1 --pretty=tformat:'reltemp@%h: %s'`" m65tools-*-macos.7z
48+
fi
49+
50+
- name: Set up deployment tag
51+
if: github.event_name != 'pull_request'
52+
run: |
53+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
54+
echo "TAG_NAME=${{ github.ref_name }}" >> $GITHUB_ENV
55+
elif [[ "${{ github.ref }}" == "refs/heads/development" ]]; then
56+
echo "TAG_NAME=CI-development-latest" >> $GITHUB_ENV
57+
fi
58+
59+
- name: Deploy to GitHub Releases
60+
if: github.event_name != 'pull_request' && env.TAG_NAME != ''
61+
uses: softprops/action-gh-release@v1
62+
with:
63+
files: m65tools-*-macos.7z
64+
tag_name: ${{ env.TAG_NAME }}
65+
prerelease: true
66+
draft: false
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

src/gitversion.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ if [[ -n $JENKINS_SERVER_COOKIE ]]; then
2424
version=${GIT_COMMIT:0:7}
2525
buildnum=${BUILD_NUMBER}
2626
else
27-
if [[ -n $TRAVIS_BRANCH ]]; then
28-
branch=$TRAVIS_BRANCH
29-
buildnum=$TRAVIS_BUILD_NUMBER
27+
if [[ -n $GITHUB_RUN_NUMBER ]]; then
28+
branch=$(git rev-parse --abbrev-ref HEAD)
29+
buildnum=$GITHUB_RUN_NUMBER
3030
else
3131
branch=`git rev-parse --abbrev-ref HEAD`
3232
buildnum=man

0 commit comments

Comments
 (0)