Go #129
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 workflow will build a golang project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
name: Go | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 20 * * 1' | |
# push: | |
# branches: [ "main" ] | |
# pull_request: | |
# branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.19 | |
- name: Download | |
env: | |
MGA_TOKEN: ${{ secrets.MGA_TOKEN }} | |
run: | | |
URL="https://offline-live1.services.u-blox.com/GetOfflineData.ashx?token=${{ secrets.MGA_TOKEN }};gnss=gps" | |
cd cmd/mga | |
go build ./... | |
./mga download "https://offline-live1.services.u-blox.com/GetOfflineData.ashx?token=${{ secrets.MGA_TOKEN }};gnss=gps" | |
test mgaoffine.ubx | |
test mgaoffine.md5 | |
cp mgaoffline.md5 mgaoffine.md5 | |
cp mgaoffline.ubx mgaoffine.ubx | |
ls -la | |
- name: Copy file to s3 | |
shell: bash | |
env: | |
aws_key_id: ${{ secrets.AWS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws_s3_bucket: ${{ secrets.AWS_BUCKET }} | |
run: | | |
sudo apt-get update && sudo apt-get -y install awscli | |
aws configure set aws_access_key_id $aws_key_id | |
aws configure set aws_secret_access_key $aws_secret_access_key | |
aws configure set default.region us-west-2 | |
echo "Configure complete" | |
aws s3 cp cmd/mga/mgaoffline.ubx s3://$aws_s3_bucket/mgaoffline.ubx | |
aws s3 cp cmd/mga/mgaoffline.md5 s3://$aws_s3_bucket/mgaoffline.md5 | |
aws s3 cp cmd/mga/mgaoffine.ubx s3://$aws_s3_bucket/mgaoffine.ubx | |
aws s3 cp cmd/mga/mgaoffine.md5 s3://$aws_s3_bucket/mgaoffine.md5 | |