Compare commits
3 commits
a1ee2b7e61
...
174cf20692
Author | SHA1 | Date | |
---|---|---|---|
174cf20692 | |||
3edb9a59a4 | |||
9644640e6c |
2 changed files with 36 additions and 22 deletions
|
@ -1,9 +1,14 @@
|
||||||
on: [push]
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- run: |
|
- name: Setup SSH
|
||||||
|
run: |
|
||||||
mkdir ~/.ssh
|
mkdir ~/.ssh
|
||||||
chmod 700 ~/.ssh
|
chmod 700 ~/.ssh
|
||||||
echo "${{ secrets.ALTAIR_SSH_KEY }}" > ~/.ssh/id_ed25519
|
echo "${{ secrets.ALTAIR_SSH_KEY }}" > ~/.ssh/id_ed25519
|
||||||
|
@ -11,18 +16,22 @@ jobs:
|
||||||
ssh-keyscan -p 999 tehga.me >> ~/.ssh/known_hosts
|
ssh-keyscan -p 999 tehga.me >> ~/.ssh/known_hosts
|
||||||
ssh-keyscan -p 999 doradus.tehga.me >> ~/.ssh/known_hosts
|
ssh-keyscan -p 999 doradus.tehga.me >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
- run: git clone --depth 1 ssh://gitea@tehga.me:999/wasp/fj.git --branch main --single-branch /workdir
|
- name: Checkout
|
||||||
|
run: git clone --depth 1 ssh://gitea@tehga.me:999/wasp/fj.git --branch main --single-branch /workdir
|
||||||
|
|
||||||
- uses: actions/setup-go@v5
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version-file: '/workdir/go.mod'
|
go-version-file: '/workdir/go.mod'
|
||||||
check-latest: true
|
check-latest: true
|
||||||
cache-dependency-path: "/workdir/**/*.sum"
|
cache-dependency-path: "/workdir/**/*.sum"
|
||||||
|
|
||||||
- run: go build
|
- name: Build
|
||||||
|
run: go build
|
||||||
working-directory: /workdir
|
working-directory: /workdir
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: fj.zip
|
name: fj.zip
|
||||||
path: /workdir/fj
|
path: /workdir/fj
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags: 'v*'
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- run: |
|
- name: Setup SSH
|
||||||
|
run: |
|
||||||
mkdir ~/.ssh
|
mkdir ~/.ssh
|
||||||
chmod 700 ~/.ssh
|
chmod 700 ~/.ssh
|
||||||
echo "${{ secrets.ALTAIR_SSH_KEY }}" > ~/.ssh/id_ed25519
|
echo "${{ secrets.ALTAIR_SSH_KEY }}" > ~/.ssh/id_ed25519
|
||||||
|
@ -14,28 +16,31 @@ jobs:
|
||||||
ssh-keyscan -p 999 tehga.me >> ~/.ssh/known_hosts
|
ssh-keyscan -p 999 tehga.me >> ~/.ssh/known_hosts
|
||||||
ssh-keyscan -p 999 doradus.tehga.me >> ~/.ssh/known_hosts
|
ssh-keyscan -p 999 doradus.tehga.me >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
- run: git clone --depth 1 ssh://gitea@tehga.me:999/wasp/fj.git --branch main --single-branch /workdir
|
- name: Checkout
|
||||||
|
run: git clone --depth 1 ssh://gitea@tehga.me:999/wasp/fj.git --branch main --single-branch /workdir
|
||||||
|
|
||||||
- uses: actions/setup-go@v5
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version-file: '/workdir/go.mod'
|
go-version-file: '/workdir/go.mod'
|
||||||
check-latest: true
|
check-latest: true
|
||||||
cache-dependency-path: "/workdir/**/*.sum"
|
cache-dependency-path: "/workdir/**/*.sum"
|
||||||
|
|
||||||
- name: apt install curl jq make
|
- name: Apt install curl jq make
|
||||||
run: |
|
run: |
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
apt-get update -qq
|
apt-get update -qq
|
||||||
apt-get -q install -y -qq curl jq make
|
apt-get -q install -y -qq curl jq make
|
||||||
|
|
||||||
- name: build release
|
- name: Build release
|
||||||
run: |
|
run: |
|
||||||
version="${{ github.ref_name }}"
|
version="${{ github.ref_name }}"
|
||||||
mkdir release
|
mkdir release
|
||||||
go build -ldflags "-extldflags -static -s -w -X \"main.Version=${version##*v}\""
|
go build -ldflags "-extldflags -static -s -w -X \"main.Version=${version##*v}\""
|
||||||
cp -a /workdir/fj release/fj
|
cp -a /workdir/fj release/fj
|
||||||
|
working-directory: /workdir
|
||||||
|
|
||||||
- name: publish release
|
- name: Publish release
|
||||||
uses: https://code.forgejo.org/actions/forgejo-release@v2.5.1
|
uses: https://code.forgejo.org/actions/forgejo-release@v2.5.1
|
||||||
with:
|
with:
|
||||||
url: "https://tehga.me/forgejo/"
|
url: "https://tehga.me/forgejo/"
|
||||||
|
@ -43,8 +48,8 @@ jobs:
|
||||||
direction: upload
|
direction: upload
|
||||||
tag: "${{ github.ref_name }}"
|
tag: "${{ github.ref_name }}"
|
||||||
sha: "${{ github.sha }}"
|
sha: "${{ github.sha }}"
|
||||||
release-dir: release
|
release-dir: /workdir/release
|
||||||
token: ${{ github.token }}
|
token: ${{ secrets.FJ_REGISTRY_TOKEN }}
|
||||||
override: ${{ vars.OVERRIDE || "false" }}
|
override: ${{ vars.OVERRIDE || "false" }}
|
||||||
verbose: ${{ vars.VERBOSE || "false" }}
|
verbose: ${{ vars.VERBOSE || "false" }}
|
||||||
hide-archive-link: true
|
hide-archive-link: true
|
||||||
|
|
Loading…
Add table
Reference in a new issue