Skip to content

Release Nightly

Release Nightly #21

name: Release Nightly
on:
schedule:
- cron: '0 0 * * *'
workflow_call: {}
# Can be triggered manually if needed
workflow_dispatch: {}
jobs:
release-nightly:
runs-on: ubuntu-latest
permissions:
contents: write
env:
ATLASCODE_FX3_API_KEY: ${{ secrets.ATLASCODE_FX3_API_KEY }}
ATLASCODE_FX3_ENVIRONMENT: ${{ vars.ATLASCODE_FX3_ENVIRONMENT }}
ATLASCODE_FX3_TARGET_APP: ${{ vars.ATLASCODE_FX3_TARGET_APP }}
ATLASCODE_FX3_TIMEOUT: ${{ vars.ATLASCODE_FX3_TIMEOUT }}
steps:
- uses: actions/checkout@v4
- name: Evaluate version
run: |
PACKAGE_VERSION=$(./scripts/version/get-next-nightly.sh)
./scripts/version/assert-nightly.sh $PACKAGE_VERSION
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
echo "RELEASE_TAG=v${PACKAGE_VERSION}-nightly" >> $GITHUB_ENV
echo "Using version '${PACKAGE_VERSION}'"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Set version
run: |
npm -no-git-tag-version --allow-same-version -f version $PACKAGE_VERSION
- name: Install dependencies
run: npm install
- name: Run linter
run: npm run lint
- name: Run unit tests
run: npm run test
- name: Fetch E2E image
run: |
docker pull ghcr.io/atlassian/atlascode-e2e:latest
docker tag ghcr.io/atlassian/atlascode-e2e:latest atlascode-e2e
- name: Run E2E tests
run: npm run test:e2e:docker
# TODO: might want to run this first, and reuse the .vsix in E2E tests instead
- name: Build the extension
run: npm run extension:package:prerelease
- name: Publish the pre-release extension
run: |
npx vsce publish \
--pre-release \
--baseContentUrl https://raw.githubusercontent.com/atlassian/atlascode/main/ \
-p ${{ secrets.VSCE_MARKETPLACE_TOKEN }} \
--packagePath atlascode-${PACKAGE_VERSION}.vsix
- name: Publish the pre-release to OpenVSX
run: |
npx ovsx publish \
--pre-release \
-p ${{ secrets.OPENVSX_KEY }} \
"atlascode-${PACKAGE_VERSION}.vsix"
- name: Create Tag
run: |
git config --global user.email "atlascode-nightly@atlassian.com"
git config --global user.name "Nightly Release Bot"
git tag -a $RELEASE_TAG -m "Nightly build for $(date +'%Y-%m-%d %H:%M')"
git push origin $RELEASE_TAG
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_TAG }}
release_name: Release ${{ env.RELEASE_TAG }}
draft: false
prerelease: true
- name: Upload Release Assets
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./atlascode-${{ env.PACKAGE_VERSION }}.vsix
asset_name: atlascode-${{ env.PACKAGE_VERSION }}.vsix
asset_content_type: application/zip