Begin implementing a script to check if a tag exists via forgejo API for my release workflow

This commit is contained in:
Oliver 2025-11-16 01:01:26 -07:00
parent 0362342419
commit 58893f46db
2 changed files with 74 additions and 0 deletions

View file

@ -0,0 +1,63 @@
on: [ workflow_dispatch ]
jobs:
create-artifacts:
runs-on: act
steps:
- name: checkout code
uses: actions/checkout@v4
- name: extract version from manifest
id: version
run: cat system.json | echo version=`jq -r ".version"` >> "$FORGEJO_OUTPUT"
- name: assert that the tag doesn't exist
run: node scripts/tagExists.mjs
env:
TAG_NAME: ${{steps.version.output.version}}
- name: build compendia
run: node scripts/buildCompendia.mjs
- name: compress files
run: zip -r release.zip langs module styles templates README.md assets
- name: upload artifacts
uses: https://data.forgejo.org/forgejo/upload-artifact@v4
with:
path: |
system.json
release.zip
retention-days: 7
if-no-files-found: error
forgejo-release:
runs-on: docker
needs:
- create-artifacts
if: var.RELEASE_TO_FORGEJO
steps:
- name: download artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: update manifest
- name: create draft release
github-release:
runs-on: docker
needs:
- create-artifacts
if: var.RELEASE_TO_GITHUB
steps:
- name: download artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: update manifest
- name: create draft release

11
scripts/tagExists.mjs Normal file
View file

@ -0,0 +1,11 @@
const {
TAG_NAME,
FORGEJO_API_URL,
FORGEJO_REPOSITORY,
FORGEJO_REPOSITORY_OWNER,
} = process.env;
console.log(process.env)
process.exit(1);