-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af6b8c7
commit 1dc4e4e
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
stages: | ||
- build | ||
- upload | ||
- release | ||
|
||
variables: | ||
WINDOWS_EXE: "mangasee-dl.exe" | ||
LINUX_BIN: "mangasee-dl" | ||
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/release/${CI_COMMIT_TAG}" | ||
|
||
build: | ||
stage: build | ||
image: denoland/deno:latest | ||
artifacts: | ||
paths: | ||
- ./mangasee-dl | ||
- ./mangasee-dl.exe | ||
expire_in: 1 week | ||
before_script: | ||
- apt update | ||
- apt install --yes unzip | ||
script: | ||
- sh build_linux.sh | ||
- sh build_windows.sh | ||
|
||
upload: | ||
stage: upload | ||
image: curlimages/curl:latest | ||
needs: | ||
- job: build | ||
artifacts: true | ||
rules: | ||
- if: $CI_COMMIT_TAG | ||
script: | ||
- echo "${PACKAGE_REGISTRY_URL}/${WINDOWS_EXE}" | ||
- 'curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file ./${WINDOWS_EXE} "${PACKAGE_REGISTRY_URL}/${WINDOWS_EXE}"' | ||
- echo "${PACKAGE_REGISTRY_URL}/${LINUX_BIN}" | ||
- 'curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file ./${LINUX_BIN} "${PACKAGE_REGISTRY_URL}/${LINUX_BIN}"' | ||
|
||
release: | ||
stage: release | ||
image: registry.gitlab.com/gitlab-org/release-cli:latest | ||
needs: | ||
- job: upload | ||
artifacts: false | ||
rules: | ||
- if: $CI_COMMIT_TAG # Run this job when a tag is created manually | ||
script: | ||
- echo "running release_job for $CI_COMMIT_TAG" | ||
- > | ||
release-cli create --name "Version ${CI_COMMIT_TAG}" | ||
--tag-name $CI_COMMIT_TAG | ||
--description "${CI_COMMIT_MESSAGE} - Created using the release-cli ${EXTRA_DESCRIPTION}" | ||
--assets-link "[{\"name\":\"${WINDOWS_EXE}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${WINDOWS_EXE}\"},{\"name\":\"${LINUX_BIN}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${LINUX_BIN}\"}]" | ||
# release: | ||
# name: "Version $CI_COMMIT_TAG" | ||
# description: "$CI_COMMIT_MESSAGE \nCreated using the release-cli $EXTRA_DESCRIPTION" # $EXTRA_DESCRIPTION must be defined | ||
# tag_name: "$CI_COMMIT_TAG" # elsewhere in the pipeline. | ||
# ref: "$CI_COMMIT_TAG" | ||
# assets: | ||
# links: | ||
# - name: "${RELEASE_FILE}" | ||
# url: "${PACKAGE_REGISTRY_URL}/${RELEASE_FILE}" | ||
|