diff options
author | techknowlogick <techknowlogick@gitea.io> | 2023-06-16 13:00:39 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-16 17:00:39 +0000 |
commit | 0ab9b7f426d2bebea450a46fa81de7444640bde7 (patch) | |
tree | 7d877fd8fc44fe6d486b045963ac33ccf73bee16 /.github | |
parent | 86d019682f0406e6e1739a31d72a2686ff8764cb (diff) | |
download | gitea-0ab9b7f426d2bebea450a46fa81de7444640bde7.tar.gz gitea-0ab9b7f426d2bebea450a46fa81de7444640bde7.zip |
Build nightly binaries with Actions (#25308)
Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/cron-licenses.yml | 1 | ||||
-rw-r--r-- | .github/workflows/cron-translations.yml | 1 | ||||
-rw-r--r-- | .github/workflows/release-nightly.yml | 59 |
3 files changed, 61 insertions, 0 deletions
diff --git a/.github/workflows/cron-licenses.yml b/.github/workflows/cron-licenses.yml index 8642049117..700d45a3c8 100644 --- a/.github/workflows/cron-licenses.yml +++ b/.github/workflows/cron-licenses.yml @@ -3,6 +3,7 @@ name: cron-licenses on: schedule: - cron: "7 0 * * 1" # every Monday at 00:07 UTC + workflow_dispatch: jobs: cron-licenses: diff --git a/.github/workflows/cron-translations.yml b/.github/workflows/cron-translations.yml index a7c9ceabd3..3f147c685d 100644 --- a/.github/workflows/cron-translations.yml +++ b/.github/workflows/cron-translations.yml @@ -3,6 +3,7 @@ name: cron-translations on: schedule: - cron: "7 0 * * *" # every day at 00:07 UTC + workflow_dispatch: jobs: crowdin-pull: diff --git a/.github/workflows/release-nightly.yml b/.github/workflows/release-nightly.yml new file mode 100644 index 0000000000..4281c2ca09 --- /dev/null +++ b/.github/workflows/release-nightly.yml @@ -0,0 +1,59 @@ +name: release-nightly-assets + +on: + push: + branches: [ main, release/v* ] + +jobs: + nightly-binary: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # fetch all commits instead of only the last as some branches are long lived and could have many between versions + # fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567 + - run: git fetch --unshallow --quiet --tags --force + - uses: actions/setup-go@v4 + with: + go-version: ">=1.20" + check-latest: true + - uses: actions/setup-node@v3 + with: + node-version: 20 + - run: make deps-frontend deps-backend + # xgo build + - run: make release + env: + TAGS: bindata sqlite sqlite_unlock_notify + - name: import gpg key + id: import_gpg + uses: crazy-max/ghaction-import-gpg@v5 + with: + gpg_private_key: ${{ secrets.GPGSIGN_KEY }} + passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }} + - name: sign binaries + run: | + for f in dist/release/*; do + echo '${{ secrets.GPGSIGN_PASSPHRASE }}' | gpg --pinentry-mode loopback --passphrase-fd 0 --batch --yes --detach-sign -u ${{ steps.import_gpg.outputs.fingerprint }} --output "$f.asc" "$f" + done + # clean branch name to get the folder name in S3 + - name: Get cleaned branch name + id: clean_name + run: | + REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//') + echo "Cleaned name is ${REF_NAME}" + echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT" + - name: upload binaries to s3 + uses: jakejarvis/s3-sync-action@master + env: + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: ${{ secrets.AWS_REGION }} + SOURCE_DIR: dist/release + DEST_DIR: gitea/${{ steps.clean_name.outputs.branch }} + nightly-docker: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: docker/setup-buildx-action@v1 + # build for linux/amd64, and linux/arm64 (possibly include linux/arm/v7 later. not included now because it adds significant amount to the build time) |