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:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: |
|
||||
- name: Setup SSH
|
||||
run: |
|
||||
mkdir ~/.ssh
|
||||
chmod 700 ~/.ssh
|
||||
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 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:
|
||||
go-version-file: '/workdir/go.mod'
|
||||
check-latest: true
|
||||
cache-dependency-path: "/workdir/**/*.sum"
|
||||
|
||||
- run: go build
|
||||
- name: Build
|
||||
run: go build
|
||||
working-directory: /workdir
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: fj.zip
|
||||
path: /workdir/fj
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
on:
|
||||
push:
|
||||
tags: 'v*'
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: |
|
||||
- name: Setup SSH
|
||||
run: |
|
||||
mkdir ~/.ssh
|
||||
chmod 700 ~/.ssh
|
||||
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 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:
|
||||
go-version-file: '/workdir/go.mod'
|
||||
check-latest: true
|
||||
cache-dependency-path: "/workdir/**/*.sum"
|
||||
|
||||
- name: apt install curl jq make
|
||||
- name: Apt install curl jq make
|
||||
run: |
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update -qq
|
||||
apt-get -q install -y -qq curl jq make
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update -qq
|
||||
apt-get -q install -y -qq curl jq make
|
||||
|
||||
- name: build release
|
||||
- name: Build release
|
||||
run: |
|
||||
version="${{ github.ref_name }}"
|
||||
mkdir release
|
||||
go build -ldflags "-extldflags -static -s -w -X \"main.Version=${version##*v}\""
|
||||
cp -a /workdir/fj release/fj
|
||||
version="${{ github.ref_name }}"
|
||||
mkdir release
|
||||
go build -ldflags "-extldflags -static -s -w -X \"main.Version=${version##*v}\""
|
||||
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
|
||||
with:
|
||||
url: "https://tehga.me/forgejo/"
|
||||
|
@ -43,8 +48,8 @@ jobs:
|
|||
direction: upload
|
||||
tag: "${{ github.ref_name }}"
|
||||
sha: "${{ github.sha }}"
|
||||
release-dir: release
|
||||
token: ${{ github.token }}
|
||||
release-dir: /workdir/release
|
||||
token: ${{ secrets.FJ_REGISTRY_TOKEN }}
|
||||
override: ${{ vars.OVERRIDE || "false" }}
|
||||
verbose: ${{ vars.VERBOSE || "false" }}
|
||||
hide-archive-link: true
|
||||
|
|
Loading…
Add table
Reference in a new issue